Determining control type

G

Gary Hillerson

Can I determine what type of control I've landed on from the control
itself?

e.g. can I have a function like the following?

Private Function GetControlType(ctrl as Control) as String
if ctrl <is a textbox> Then
GetControlType = "TextBox"
ElseIf ctrl <is a checkbox> Then
GetControlType = "CheckBox"
....

End Sub

Is there a property that reliably exists in every control that tells
me its type?

thanks,
gary
 
Top