Windows Develop Bookmark and Share   
 index > Windows Forms General > Accessing form components from outside the form
 

Accessing form components from outside the form

Hi,

I have two classes, one form (mainGui) and one regular class (class1). mainGui creates class1 sending itself to the class1 constructor and is saved as a class variable. Now, I want to access mainGui components such as checkboxes, textboxes etc from class1.

How would I do that?

Thanks for all answers
/Hubba

MigrationUser 1  Thursday, January 20, 2005 1:19 PM
Found the answer to my problem. The components in the form are private and therefore not accessible. I just realized that perhaps it is not a good idea to make them public. It is better to create a get function that returns true if e.g. a checkbox is checked.

Feel free to comment.

/Hubba
MigrationUser 1  Thursday, January 20, 2005 3:28 PM

You can use google to search for other answers

Custom Search

More Threads

• Please Any help (MdiWindowListItem)
• how to make the size and location of the form unchangeable?
• Need help with setting up a comboBox
• please help with my colour button's icon
• how can I open a file and save it in another location
• Component required build Email Editor in vb.net
• Add listbox by using for/next
• How to Pass Events for Handling To Parent Control In C# Windows Application
• Adding selected ListBox Items to an ArrayList?
• ProgressbarStyle Continuous