Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
User Control Question
Message
From
23/06/2006 13:05:46
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
ASP.NET
Category:
Forms
Miscellaneous
Thread ID:
01131113
Message ID:
01131243
Views:
11
>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
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform