Help with custom properties in my own control

A

André Nogueira

Hi there.
I have my own control and can add properties that are integers or strings or
icons or whatever.
But how can I make a property that only lets the user select a predefined
value?
Like in the Visible property you can't enter your own values, you can just
select True or False.
I'd like to have a property where the user can only select "Value A" "Value
B" or "Value C". I do not want it to be a boolean (as True and False are)
but my custom strings.
Can this be done? How?
Thank you in advance.

André Nogueira
 
H

Herfried K. Wagner [MVP]

* "André Nogueira said:
I have my own control and can add properties that are integers or strings or
icons or whatever.
But how can I make a property that only lets the user select a predefined
value?

\\\
Public Enum Bars
FooBar
GooBar
DooBar
End Enum
..
..
..

Private m_MyBars As Bars

Public Property MyBars() As Bars
Get
Return m_MyBars
End Get
Set(ByVal Value As Bars)
m_MyBars = Value
End Set
End Property
///
 

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