|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Finding embedded controls?I am trying to write code to clear all the textboxes on a VB.NET windows form using: Dim ctrl As Control For Each ctrl In Me.Controls 'Add your code here If TypeOf ctrl Is TextBox Then ctr.text = "" End If Next When I debug, I realized that none of the text boxes are being recognized as they are present within tabcontrol and embedded within a frame. So how exactly do we find out all the controls that are present on a tabpage and are embedded within a frame? Any Help is appreciated. I found out the solution...
Dim ctrl, ctrl2 As Control For Each ctrl In Me.Controls If TypeOf ctrl Is Panel Then For Each ctrl2 In ctrl.Controls If ctrl2.Text = "Go" Then ' Do Something End If Next End If That works if you are only looking for the panel's child controls. What if
you have a panel within a panel that contains textboxes? Try recursion. -- Show quoteHide quoteDennis in Houston "IdleBrain" wrote: > I found out the solution... > Dim ctrl, ctrl2 As Control > For Each ctrl In Me.Controls > If TypeOf ctrl Is Panel Then > For Each ctrl2 In ctrl.Controls > If ctrl2.Text = "Go" Then > ' Do Something > End If > Next > End If > >
Securing my app with serial number
Whats the right approach for getting a job Challenging PRoblem in VB.NET. Encrypt a date to use in demo version System.Diagnostics.Process.Start Freezes No Recursive instr?!! Problem with mutex Do I need to install Excel on the server? RTf to Word.Doc C# to VB Conversion Help - Overriding Events? |
|||||||||||||||||||||||