defaultvalue atribute not working

  • Thread starter Thread starter Vicky
  • Start date Start date
V

Vicky

i am setting deaultvalue attribute for one of the property in my own
usercontrol. No error was coming but when i add that control on form, its
property in property window is not set with the default value. Whereas
Description attribute is working fine


Thanks
 
* "Vicky said:
i am setting deaultvalue attribute for one of the property in my own
usercontrol. No error was coming but when i add that control on form, its
property in property window is not set with the default value. Whereas
Description attribute is working fine

"Post code."
 
My code goes like this

<Browsable(True), CategoryAttribute("Design"), Description("For Saving
Record")> _

Public Property Save_Caption() As String

Get

Return p_SaveCaption

End Get

Set(ByVal Value As String)

p_SaveCaption = Value

objSave.Text = p_SaveCaption

End Set

End Property

Vicky
 
* "Vicky said:
My code goes like this

<Browsable(True), CategoryAttribute("Design"), Description("For Saving
Record")> _

But you didn't add the 'DefaultValue' attribute... ;-)
 
Sorry it was there earlier but while testing i removed it so the code is
like this

<Browsable(True),DefaultValue("Save"), CategoryAttribute("Design"),
Description("For Saving
Record")> _

Public Property Save_Caption() As String

Get

Return p_SaveCaption

End Get

Set(ByVal Value As String)

p_SaveCaption = Value

objSave.Text = p_SaveCaption

End Set

End Property
 
* "Vicky said:
Sorry it was there earlier but while testing i removed it so the code is
like this

Mhm... What value does the IDE use? What's the property value if you
choose "Reset" from the property's context menu in the IDE?
 
Back
Top