Hi,
I'm sure this is easy but I can't seem to find it in the M$ Doco....
How can I add a custom property to a VB.NET Windows control?
I previously used the Add Property wizard in VB6 ... how do I do it in VB.NET???
Thanks!
Tim
Printable View
Hi,
I'm sure this is easy but I can't seem to find it in the M$ Doco....
How can I add a custom property to a VB.NET Windows control?
I previously used the Add Property wizard in VB6 ... how do I do it in VB.NET???
Thanks!
Tim
VB Code:
Private _age As Int32 Property Age() As Int32 Get Return _age End Get Set(ByVal Value As Int32) _age = Value End Set End Property
Thanks DevGrp ...
Just to confirm .. I'm looking for Properties available at
Design time .. when I added a class propertie it didn't seem to be available in the Forms designer ... can you confirm?
Cheers,
Tim
I think you might have to use attributes.
You need to use the System.ComponentModel namespace like:
VB Code:
<System.ComponentModel.Category("NameOfYourCategoryGoesHere")> _
You can also set the description, etc.
Excellent! Thanks VBCC - I knew it would be easy ...
For future reference the complete code looks like:
Cheers,Code:
<System.ComponentModel.Description("The SOAP Header with the control"), _
System.ComponentModel.Category("SOAPHeader")> _
Public Property WebServiceSOAPHeader() As String
Get
Return mWSSOAPHeader
End Get
Set(ByVal Value As String)
mWSSOAPHeader = Value
End Set
End Property
Tim