如何将超级脚本放在列表框中...... [英] How to put super script in a list box...

查看:51
本文介绍了如何将超级脚本放在列表框中......的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个列表框。一些单位将填入其中。有单选按钮,如果我点击缩写,像''centimetercubed''这样的单位应该被显示为cm ^ 3 ...即。 3应该超级厘米....所以请帮助我....





提前致谢。



问候,

Naveen

I have a list box. some units will be populated inside it. there is radio button if i click on abbreviation the units like ''centimetercubed'' should be diaplayed as cm^3...i.e,. 3 should be super scribed to cm....so pls help me....


Thanks in advance.

Regards,
Naveen

推荐答案

有两种方法可以做到,简单的方法就是使用正确的unicode字符。您可以在CharMap中找到字体中的方形和立方字符(Win + R,键入charmap然后按Enter键,找到字符,复制然后粘贴到Items集合中)。 (或者,您可以按住ALT键,然后键入0178作为上标2,或输入ALT + 0179作为上标3,但这只适用于您有数字小键盘的情况。)



另一种方法是自定义绘制每个列表框项目并且要困难得多。列表框有一组您可以覆盖或实现的例程,允许自定义绘制列表框项目。



请看这个例子:

http://msdn.microsoft.com/en-us/library/ms229679(v=vs.80).aspx [ ^ ]
There are two ways to do it, the easy way is to just use the proper unicode character. You can find the squared and cubed characters in the CharMap for the font (Win+R, type charmap then hit enter, find the character, copy and then paste in your Items collection). (Or, you can hold the ALT key down then type 0178 for the superscript 2, or ALT+0179 for the superscript 3, but this only works if you have a numeric keypad).

The other way to do it involves custom drawing each listbox item and is much more difficult. The listbox has a set of routines you can override or implement that allows custom drawing of the listbox items.

See this for an example:
http://msdn.microsoft.com/en-us/library/ms229679(v=vs.80).aspx[^]


这篇关于如何将超级脚本放在列表框中......的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆