|
-
May 12th, 2004, 12:05 PM
#1
Thread Starter
Addicted Member
Access Controls Properties From Another Window
I am trying to change a property from one control one a window from another. How would I add data that is in one window to a combobox in another? Thanks.
-
May 12th, 2004, 12:07 PM
#2
Addicted Member
The easy way would be to have the form have a reference to the other form.
-
May 12th, 2004, 12:09 PM
#3
Thread Starter
Addicted Member
Can you give me an example. I am kind of new to C#
-
May 12th, 2004, 12:25 PM
#4
Addicted Member
Ok well i will asume you are opening one form from the other.
Code:
class form1
{
private form2 child;
public form1()
{
child = new form2(this);
}
}
class form2
{
private form1 parent;
public form2(form1 parent)
{
this.parent = parent;
}
}
Simply put you could use the child object to access controls on form2 from form1 and the parent object to access controls on form1 from form2.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|