Custom Control Property Question

E

Ed Bick

I built a custom control. It has one custom property that I created
exposed. What I want to do though is to have the property show as a
dropdown with only a limited number of choices for settings. An example
would be the dropdown style of a combo box. The designer can only select
one of three previously defined options and can not type anything arbitrary
in.

Can anyone explain how to do that?
 
T

Tom Spink

Yes, you need to create an Enumeration, or Enum, containing the possible
values for your property. Then, you change the property type to that
enumeration:

Public Enum MyPropVals
Value1
Value2
Value3
End Enum

'===
Public Property MyProp() As MyPropVals
Get
Return m_PropLocal
End Get
Set (ByVal Value As MyPropVals)
m_PropLocal = Value
End Set
End Property
'===
--
HTH,
-- Tom Spink, Über Geek

Woe be the day VBC.EXE says, "OrElse what?"

Please respond to the newsgroup,
so all can benefit
 

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