PC Review


Reply
Thread Tools Rate Thread

Custom Control Property Question

 
 
Ed Bick
Guest
Posts: n/a
 
      20th Feb 2004
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?


 
Reply With Quote
 
 
 
 
Tom Spink
Guest
Posts: n/a
 
      20th Feb 2004
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
"Ed Bick" <(E-Mail Removed)> wrote in message
news:WtqdnSILUZeV0qjdRVn-(E-Mail Removed)...
> 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?
>
>



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do you access a control property of a main form from a custom user control? forest demon Microsoft C# .NET 6 22nd Aug 2007 11:36 PM
question on best way to get a control's property from custom control TS Microsoft ASP .NET 5 6th Jul 2007 02:41 AM
feeding a SQLDataSource embedded in an .ascx user control a custom property assigned to that control Microsoft ASP .NET 4 16th Jul 2006 01:20 PM
can a custom control have an image property that can be set in design time from the property browser? news.austin.rr.com Microsoft Dot NET Compact Framework 3 3rd Mar 2005 02:08 AM
Custom Control Property HelpText Property =?Utf-8?B?R3JleUFsaWVuMDA3?= Microsoft Dot NET Framework Forms 1 20th Jan 2005 06:17 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:55 AM.