There are few ways to do this. Here is one.
Lets say your main FORM class name is FMain and your child FORM class is called FChild. Then consider the following:
Again, you have so many ways depending on how you instantiate the child form. The basic idea is to have a reference to the parent object so that you can access any exposed members (declared with either PUBLIC or FRIEND).Code:' your main FORM public class FMain ... ' when you add a control the declaration should look like this friend withevents txtUsername as textbox ... ' show the child private sub showchild() dim myChild as new FChild() myChild.ParentForm = me .... end sub ... end class ' your child FORM public class FChild ... ' var to hold the parent public ParentForm as FMain = Nothing ... ' access the textbox in main form private sub DummyProc() if (not m_MainForm is nothing) then m_MainForm.txtUsername.Text = "From CHILD class." end sub ... end class
//EDIT: variable name in child form was corrected.
-Cool Bizs




Reply With Quote