Get all controls on a form.
Printable View
Get all controls on a form.
Hey NightWalker, Try:
VB Code:
Private Sub Command1_Click() Dim cntl As Control For Each cntl In Controls List1.AddItem cntl.Name Next End Sub
VB Code:
For Each Ctl In Me.Controls Debug.Print Ctl.Name Next
IF you had to use the example in ur post, the sytax is:
TypeOf Control Is
Bruce.
The example uses that code;)Quote:
Originally posted by Bruce Fox
Hey NightWalker, Try:
VB Code:
Private Sub Command1_Click() Dim cntl As Control For Each cntl In Controls List1.AddItem cntl.Name Next End Sub
hehe, No it dosn't.... look closely :)Quote:
Originally posted by Nightwalker83
The example uses that code;)
(Hint: If Then........)
Yeah but still does the same job and doesn't change the size or speed of the app;)Quote:
Originally posted by Bruce Fox
hehe, No it dosn't.... look closely :)
(Hint: If Then........)
Oh, hang on... I thought u were posting a problem!
That is why I sent those examples.. Yes, your code does
work the way u have it :)
Quote:
Originally posted by Nightwalker83
Yeah but still does the same job and doesn't change the size or speed of the app;)
Speed, Oh yes it does.... :D