"JC Voon" <jc*******@yahoo.com> schrieb:
My component has a property which type is control, i want it to accept
only textbox and combobox, how to tell the properties windows, when
drop down or set the property, it only show or accept the textbox and
combobox control ?
All you can do (AFAIK) is checking the class name of the assigned value:
\\\
Private m_TheControl As Control
Public Property TheControl() As Control
Get
Return m_TheControl
End Get
Set(ByVal Value As Control)
If TypeOf Value Is TextBox OrElse TypeOf Value Is ComboBox Then
m_TheControl = Value
Else
Throw _
New ArgumentException( _
"The control must be either a textbox or combobox." _
)
End If
End Set
End Property
///
--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>