>Hello All, I just created my first user control in VS 2005, it consists of a TabControl with two pages, and several textboxes and labels on each page, I built it, and added it to my toolbox, however !, having placed the control on a form, I cant access any of the controls within it ?, is this normal ?, I expected the UC to behave like a VFP container, obviously they don't
Pete,
It doesn't like it does in VFP:)
-First be sure to name your labels/textboxes etc in a way that you can remember.
-Set the controls' Modifier property to Public for those you want to access (ie: You might want a label to stay put as is while another be touched in your form).
-Save comppile etc (adding to toolbox part).
In a form you reference to a textbox named txtName like this:
this.txtName
txtName
IOW you're on the same level. Now drop your usercontrol say named myUserControl. A textbox named txtName on it is:
myUserControl.txtName (on page 2 or 3 or whatever, you don't care, its name is unique within the whole usercontrol).
Sort of visual hierarchy only:)
Cetin