By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,900 Members | 1,358 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,900 IT Pros & Developers. It's quick & easy.

Problems wirh customized Property Grid

P: n/a

I want to customize a Property Grid in the following way:

The Property Grid should show a property which value should be changed
by a dropdown-listbox.

For example, there is a property called "animal" and when I want to
change the value of the property in the property grid it should show
me a dropdown-box with standard values like "cow","cat" or "bird".

In general it is not a problem. I created a new class
TStringConverterAnimal deriving from StringConverter which provides a
method StandardValuesCollection*
GetStandardValues(ITypeDescriptorContext* context). The
StandardValueCollection then contains the standard values "cow","cat"
and "bird".

This works fine - the property grid shows me a drop down - box with
the standard values.

Now my problem:

I want to show a small picture of the animal at the left side of
standard value in the dropdown-list.

My first idea was, that I create a class TAnimalPropertyEditor
deriving from
UITypeEditor. In this class I override the method
PaintValue(PaintValueEventArgs *pe), compare the String pe->Value with
the names of my animals and then I draw the picture of the animal with
pe->Graphics->... .

The problem is, that it only draws the picture of the animal beside
the first value in the dropdown-box. On the left of the other values
I can find a small Picture too, but it is empty.

How can I solve this problem?

Thanks and greetings

Andreas Poller
Andreas Poller
Student der TU Chemnitz
Fakultät für Informatik
Nov 17 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.