Mach1pro
asked on
how do you expose the properties of form controls
in Access I could do something like this:
Dim ctl as control
dim prp as property
For each ctl in me.controls
For each prp in ctl.Properties
debug.Print ctl.name & vbtab & prp.name
Next prp
Next ctl
I can't seem to do this in VB6. I want to be able to loop through the controls on a form, determine if they are a certain type eg. Textbox, command button etc and then set properties on the controls like ForeColor
Dim ctl as control
dim prp as property
For each ctl in me.controls
For each prp in ctl.Properties
debug.Print ctl.name & vbtab & prp.name
Next prp
Next ctl
I can't seem to do this in VB6. I want to be able to loop through the controls on a form, determine if they are a certain type eg. Textbox, command button etc and then set properties on the controls like ForeColor
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Any luck??
Dim ctl As Control
For Each ctl In Me.Controls
If TypeOf ctl Is TextBox Then
MsgBox (ctl.Name)
End If
Next ctl