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

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
 
B

Bob Powell [MVP]

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.
 

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