I am building a control library. I have a text box, radio button, checkbox, and a usercontrol. I added 7 properties to the text box class. Here is an example of a string DefaultValue attribute I tried adding:
<DefaultValue(GetType(String), "C"), _
Description("RICS Data Type (C=Char, N=Numeric)")> _
Public Property RICSType() As Char
Get
Return _RICSType
End Get
Set(ByVal Value As Char)
_RICSType = Value
End Set
End Property
In a different solution, I have the text box from the class on the toolbox. I drop a new, inherited text box onto a form, but the default value for string properties is null character. Here is the code:
Friend WithEvents TextBox1 As RICSLIB.Ritext
...
Me.TextBox1 = New RICSLIB.Ritext()
...
Me.TextBox1.RICSType = Microsoft.VisualBasic.ChrW(0)
<DefaultValue(GetType(String), "C"), _
Description("RICS Data Type (C=Char, N=Numeric)")> _
Public Property RICSType() As Char
Get
Return _RICSType
End Get
Set(ByVal Value As Char)
_RICSType = Value
End Set
End Property
In a different solution, I have the text box from the class on the toolbox. I drop a new, inherited text box onto a form, but the default value for string properties is null character. Here is the code:
Friend WithEvents TextBox1 As RICSLIB.Ritext
...
Me.TextBox1 = New RICSLIB.Ritext()
...
Me.TextBox1.RICSType = Microsoft.VisualBasic.ChrW(0)