|
-
March 21st, 2001, 06:48 AM
#1
How can we determine the type of a control in VB
I need to determine the type of each control on the form. That is I need to check whether a control is commandButton or checkbox etc. Using the Controls collection I can traverse through all the controls on the form, but how can i check their types?
Ali.
-
March 21st, 2001, 06:56 AM
#2
Re: How can we determine the type of a control in VB
Use TypeOf(). Be sure to use Is for comparison.
Dim aControl as Control
for each aControl in Controls
If TypeOf(aControl) is CommandButton then
MsgBox aControl.Name
End If
next
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
|