Click to See Complete Forum and Search --> : how to get the object type


cksiow
April 2nd, 2001, 11:20 PM
How do we get the object type ?

for instance,

if we got a function c(d as object) where d is any object.

how can we determine the type of object, whether it is textbox, label, etc

thanks.

GungaDin
April 2nd, 2001, 11:37 PM
Try this:



If TypeOf d is TextBox then
MsgBox "Text Box"
End if





You could also use Select Case for different types.

The Types are any control (eg. Label, CheckBox). VB should provide you with a list after you type Is.

Hope this helps,

Nathan Liebke