Re: create enumerated property for custom control

Tech-Archive recommends: Fix windows errors by optimizing your registry



Sergey,
any properties who's type are an enum will be bound to that list of
values in design mode. if you view properties of the control/class
who's property you'd like to edit, if one is an enum, VS will display a
dropdownlist with the values from the enum as a list of available
choices.

Mike MacMillan


Sergey Poberezovskiy wrote:
> Mike,
>
> I was not asking about the DesignTimeHtml - I know how to use that...
> The question was about how to implement a property similar to say,
> BorderStyle, so that when user selects the property in the Properties window
> the valid values are listed in the dropdown box.
>
> Hope that makes sense..
>
> "Mike MacMillan" wrote:
>
> > Sergey,
> > any custom information you'd like displayed by the IDE is design mode
> > is up to you to implement. take a look at the ControlDesigner class
> > and its associated members, as that will give you a headstart for
> > providing custom design-time support for your controls. here's a link
> > to the SDK:
> >
> >
> > http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemwebuidesigncontroldesignerclasstopic.asp
> >
> > hope this helps,
> > Mike MacMillan
> >
> > Sergey Poberezovskiy wrote:
> > > Hi,
> > >
> > > I want to create a property that can only accept values from my custom list.
> > > Say
> > > 1, 5, 10, 15, 20, 30.
> > >
> > > I know I can easily create an enumeration with values set to those from my
> > > list, and have the Visual Studio designer display a list of enumerated
> > > strings shown in the property (e.g. one, five, ten, etc.).
> > >
> > > What I want is a list of numbers shown in the IDE - and I have no idea how to
> > > do that...
> > >
> > > Any help is greatly appreciated.
> >
> >

.



Relevant Pages

  • Fragile Fences
    ... I have been working with Eclipse and some large enum classes. ... If engineers designed buildings the way computer programmers design ... Any unbalance has then be isolated to whether it is inside ... We need to start thinking of IDEs as data entry devices, ...
    (comp.lang.java.programmer)
  • Re: PEP 354: Enumerations in Python
    ... -1 for this particular proposal as a builtin. ... design of something that isn't terribly useful to begin with. ... As for preventing nonsensical operations on enum constants: ... Some alternative designs implement each enumeration as its own ...
    (comp.lang.python)
  • Re: Typesafe Enum Pattern
    ... impersonating the design in C#. ... designs in .NET which mirror the equivalent Java enums by using a C# ... you are obviously very passionate about improvements to the enum ... to the type-safe enum pattern to begin with. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Using a Class as parameter
    ... I moved it to a new file and it is workig ok now, ... Bruno ... should I create a new file for the enum then? ... > solutions is best is a design issue and I don't know enough about your ...
    (microsoft.public.vc.language)