IamMike4Life Posted June 7, 2010 Posted June 7, 2010 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? Quote
Administrators PlausiblyDamp Posted June 7, 2010 Administrators Posted June 7, 2010 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. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.