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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top