How get supersrcipts into combo boxes

  • Thread starter Thread starter Craig Bartels
  • Start date Start date
C

Craig Bartels

I'm using standard ComboBox for dropdown lists. I'm
putting units such as area & volume into the text, so I
need superscripts, e.g., ft3, in2, etc. I have commercial
programs now that use superscripts in various labels, but
I don't know if they were developed with MS products.

Any suggestions how to include superscripts in text?
Thanks for help!

Craig Bartels
 
Your solution most likely lies with owner drawn combo boxes. With those you
basically take over the drawing of each item in the dropdown list.
CodeProject has an article showing an example of owner-drawn combobox:

http://www.codeproject.com/cs/combobox/ownerdrawncombobox.asp

With full control over the drawing you can use your own standard for
controlling font within a string. You could devise a certain string pattern
that signifies subscripts, e.g. "ft#ss<3>", where whenever you encounter the
#ss keyword you would use a superscripted font.

It is not really easy but with owner drawn comboboxes you could take full
control of each display line.
 
Thanks a lot for this. It gave me great ideas on doing
other things also.

But I was hoping that there was a far simpler way since I
have to use so many superscripts & subscripts in text on
forms. I'm sure there are lots of others with the same
problem. If anybody else has another way of handling
this I would sure appreciate hearing about it.

Thanks again.
Craig
 
Hi Craig,

Based on my understanding, you want to implement superscript and subscript
in ComboBox in .Net.
Actully, there is not a simple way to do this, the only way is using
Owner-Draw just as Robert suggested.
For your situation, you need do this frequently, I think maybe you can
design a good encapsulate for this and then you can reuse it in many places.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
OK. Maybe comboBox control built around the RichTextBox
will be in the next version. But thanks much for those
who responded & ideas!
 
Back
Top