[Mono-winforms-list] User defined graphics in a combo box

Robert Jordan robertj at gmx.net
Wed May 5 06:35:46 EDT 2010


On 05.05.2010 12:22, pfj wrote:
>
> Hi,
>
> I'm trying to put together a small organic chemistry application which will
> allow my students to create molecules which it will then name (or that the
> program generates for the student to name). What I'm trying to do is this
>
> Type in the name of the atom (say C). To either side, above and below a
> combo appears which has in it a single (-), double (=) or triple bond (there
> is a character for that - according to OOo, its U+2261). While this is okay,
> if I want to do the same for the above and below, this will be hard as there
> is not an equals sign twisted to 90 degrees or U+2261 turned through 90
> degrees.
>
> Back when I was a lad and used the ol' 8 bit systems, I could create a user
> defined graphic which would show the || and ||| as a single character.
> Today, I'm guessing a png or bmp file would do the same, however, I can't
> see anything that says I can put a graphic in a drop-down.
>
> Can it be done?

Set DrawMode of the combobox to DrawMode.OwnerDrawFixed (or *Variable,
depending on your needs) and handle combobox' DrawItem and MeasureItem
events.

Robert



More information about the Mono-winforms-list mailing list