Custom Controls: selecting from list on property sheet...

  • Thread starter Thread starter Charlie@CBFC
  • Start date Start date
C

Charlie@CBFC

Hi:

Custom controls allows us to set object properties on property sheet at
design time. If you want property to be selected from a list of possible
values, how would you show that on property sheet with a custom control?
I'm assuming property being exposed on property sheet will have to be array
or collection.

Thanks,
Charlie
 
I'm not sure about exactly what you want to do but one of the following
should help you.

A collection property should be edited automatically by the designer as long
as you've used the DesignerSerializationVisibility attribute and set the
parameter to "Content"

If you just want to select from a set of standard properties you need to
create a TypeConverter based object and use the TypeConverter attribute on
the property. A TypeConverter can provide a list of standard values and
translate between the type and a string for editing purposes.

--
Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.
 
Back
Top