G
Guest
I have a UserControl containing combo boxes with different values. A second
UserControl needs to be able to retrieve the values from the ComboBoxes in
the first UserControl.
Both controls "live" in the same Windows.Form.
What is the best way to accomplish this? I've expermented with using
properties, static variables etc., none of which I can get to work exactly
like I would like.
One idea that has occurred to me is to use UserControl.FindForm(). This does
indeed seem to point to the right form, since, doing a quickwatch on
FindForm().Name returns the name of the Form both controls live in. However,
Intellisense, doesn't display a reference to the combobox in the first
Control and compilation fails if I manually add the combobox reference.
UserControl needs to be able to retrieve the values from the ComboBoxes in
the first UserControl.
Both controls "live" in the same Windows.Form.
What is the best way to accomplish this? I've expermented with using
properties, static variables etc., none of which I can get to work exactly
like I would like.
One idea that has occurred to me is to use UserControl.FindForm(). This does
indeed seem to point to the right form, since, doing a quickwatch on
FindForm().Name returns the name of the Form both controls live in. However,
Intellisense, doesn't display a reference to the combobox in the first
Control and compilation fails if I manually add the combobox reference.