Custom Control Properties at Design Time

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.
 
I

Imran Koradia

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.
 
G

Guest

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top