How to tell the type of a user-defined control on a windows form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I think if the object type of the control is not System.Windows.Forms.xxx,
then it is a user-defined control. But how to tell the type of the
user-defined control: Composite(User), Extended, and Custom?
 
Peter said:
I think if the object type of the control is not System.Windows.Forms.xxx,
then it is a user-defined control.

Probably, but not guaranteed. You can create user-defined controls in
the S.W.Forms namespace: ;-)

Namespace System.Windows.Forms
Class GoButton
Inherits Button
But how to tell the type of the user-defined control:
Composite(User), Extended, and Custom?

Ask the control what Type it is!

Dim ctl As Control = ...

If TypeOf ctl Is Extended Then
With DirectCast( ctl, Extended )
. . .
End With
ElseIf Typeof ctl Is Custom Then
. . .
End If

HTH,
Phill W.
 
I think if the object type of the control is not System.Windows.Forms.xxx,
then it is a user-defined control. But how to tell the type of the
user-defined control: Composite(User), Extended, and Custom?

Didn't you ask this same question a week ago?

Thanks,

Seth Rowe
 
Back
Top