C# Help

IamMike4Life

Newcomer
Joined
Jun 7, 2010
Messages
1
Hi all,

I'm new to C# and I'm having a problem. In VB.net I'm able to access the controls on another form (ex: a MDI child form) when I try to do the same in C#, the controls arn't listed. How would I go about accessing the controls on another form?
 
In VB the controls are declared as public by default, C# defaults them to private.

You could just make the controls public but this will inevitably result in the code getting very tightly coupled to the point of changing a control on a form can break code in several other forms. A far better way would be to create public properties or methods that can be called from outside the form but will themselves change / read from the controls.
 
Back
Top