OK I really ought to know what the best approach for this is, but I'd rather get some expert input -
What is the "BEST" way to access the methods and properties of nested user controls?
For example, suppose you create a custom control (FirstControl) that has a label and a text box. You then add this custom control to ANOTHER custom control (SecondControl) which adds a picture box. You then add THIS control to a Windows Form.
If you wish to set the properties on the label and text box, what is the best way to do it?
Dig down through the Controls collection i.e., Form1.Controls(0).Controls(0).Controls("Text1").Text = "mytext"?
Or, set an instance to each control in each parent control and then access this?
And then, how about monitoring an event like the text changing in the original control - do you ballon an event up through each user control until it reaches the Form, or is there a better way?
Any thoughts appreciated...
Thanks.
What is the "BEST" way to access the methods and properties of nested user controls?
For example, suppose you create a custom control (FirstControl) that has a label and a text box. You then add this custom control to ANOTHER custom control (SecondControl) which adds a picture box. You then add THIS control to a Windows Form.
If you wish to set the properties on the label and text box, what is the best way to do it?
Dig down through the Controls collection i.e., Form1.Controls(0).Controls(0).Controls("Text1").Text = "mytext"?
Or, set an instance to each control in each parent control and then access this?
And then, how about monitoring an event like the text changing in the original control - do you ballon an event up through each user control until it reaches the Form, or is there a better way?
Any thoughts appreciated...
Thanks.