How to get the type of a control

  • Thread starter Thread starter shapper
  • Start date Start date
S

shapper

Hello,

I created 3 custom controls: A, B and C.
Given a control how can I get its type and check if it is of type A, B
or C?

Thanks,
Miguel
 
If A.GetType() = B.GetType() Then.....

....or...

If GetType(A) = GetType(B) Then....

....or....

Select Case A.GetType.Name
Case B.GetType.Name
' Do something

Case C.GetType.Name
' Do something

End Select
 
maybe you could use the "IS" keyword/operator?


If A.GetType() = B.GetType() Then.....

...or...

If GetType(A) = GetType(B) Then....

...or....

Select Case A.GetType.Name
Case B.GetType.Name
' Do something

Case C.GetType.Name
' Do something

End Select
 
Yep, I realized that just as I was looking at my post. Replace "=" with
"Is" when checking a type against another type.
 
Back
Top