Unable to set Default value for UserControl property

  • Thread starter Thread starter Atchoum
  • Start date Start date
A

Atchoum

I have the following property in one UserControl. When I use the control,
the description appears Ok but the default value is stuck at False.
What am I doing wrong?
<System.ComponentModel.DefaultValue(True), _
Description("Indicates whether users with Browse rights should be
displayed")> _
Property ShowBrowseRole() As Boolean

Get
Return m_bBrowseRole
End Get

Set(ByVal Value As Boolean)
m_bBrowseRole = Value
End Set

End Property

TIA
 
Hi,

Dim m_bBrowseRole as Boolean = True

Ken
------------------
I have the following property in one UserControl. When I use the control,
the description appears Ok but the default value is stuck at False.
What am I doing wrong?
<System.ComponentModel.DefaultValue(True), _
Description("Indicates whether users with Browse rights should be
displayed")> _
Property ShowBrowseRole() As Boolean

Get
Return m_bBrowseRole
End Get

Set(ByVal Value As Boolean)
m_bBrowseRole = Value
End Set

End Property

TIA
 
* "Atchoum said:
I have the following property in one UserControl. When I use the control,
the description appears Ok but the default value is stuck at False.
What am I doing wrong?
<System.ComponentModel.DefaultValue(True), _
Description("Indicates whether users with Browse rights should be
displayed")> _

\\\
Private m_bBrowseRole As Boolean = True
///
 
Thanks for your response. I know I can do it this way.
But is this to mean that ComponentModel.DefaultValue does not work properly?
 
* "Atchoum said:
Thanks for your response. I know I can do it this way.
But is this to mean that ComponentModel.DefaultValue does not work properly?

This attribute is for the designer only. It will add a "Reset" menu
item to the property's context menu in the properties window that will
reset it to the value provided in this attribute.
 
Thanks for the explanation. I misinterpreted what I read somewhere then. I
really appreciate it.
 
Back
Top