|
-
Apr 5th, 2004, 07:48 AM
#1
Thread Starter
Frenzied Member
How to declare this variable
Im working with the infragistics ultra tab control. It is very neat way of creating tabs. The easiest way to add info the the tabs is to place all your controls etc in a user control and then add that UC to the tab you want it.
But you can't access the controls like mytab.tab(0).findcontrol("textbox1")
I have therefor written a shared helper class (which infragistics suggested) where you pass a reference to the tab, the ID of the usercontrol and the ID of the control, then it loops through the control collections and return a reference you can work with
like
VB Code:
Dim lbansvarig As ListBox = CType(WebTabHelper.GetChildControlFromUserControl(Me.uwtDriftStopp, "URegistrera1", "lbansvarig"), ListBox)
'btnNewDelete.Enabled = False
dim item as string = lbAnsvarig.Items.Count.tostring
NOW here is my issue... Say I wan to manipulate textbox3 on four different places in a class like reading value, reset value and writing value, in different methods..
Where in my class structure is most appropriate to create the reference? Like I do it now I create all references to all textboxes on page_load... What I really need is only ONE reference that can work with all the textboxes, one for labels etc...
but where in the code is most appropriate to write
dim myTextBox as TextBox ?
Should it infact be a class property???????????????????????????
Or should I write it as public class variables? It feels like this is a common architectural problem,a dn there should be a good way to do it? A pettern perhaps?
I hope you understand my concern?
kind regards
Henrik
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
|