Re: User defined graphics in a combo box

Robert Jordan <[email protected]>
Newsgroups gmane.comp.gnome.winforms
Message-ID <[email protected]>
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

_______________________________________________
Mono-winforms-list maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-winforms-list
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.