Custom Control Properties at Design Time

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a control which I wrote that has, of course, numerous properties.
These properties nicely show up at design time in the property window for the
user to set their value at design time. However, their are a few that
should be set only in code at run-time. How do I prevent these properties
from showing up in the Properties window at design time. Thanks for any
replys.
 
Apply the Browsable attribute to your property:

<Browsable(False)> _
Public Property MyProperty() As Integer
Get
' Get code
End Get
Set
' Set code
End Set
End Property

By default, the Browsable is set to True for all properties which is why you
need to explicitly set it to False if you don't want them to be modified at
design time.


hope that helps..
Imran.
 
Exactly what I was looking for...Thanks

Imran Koradia said:
Apply the Browsable attribute to your property:

<Browsable(False)> _
Public Property MyProperty() As Integer
Get
' Get code
End Get
Set
' Set code
End Set
End Property

By default, the Browsable is set to True for all properties which is why you
need to explicitly set it to False if you don't want them to be modified at
design time.


hope that helps..
Imran.
 
Back
Top