标签上的标签,一个“胶合”标签。在其他方面 [英] label on a label, one "glued" on other

查看:70
本文介绍了标签上的标签,一个“胶合”标签。在其他方面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

标签为例:g_hi =我用两个标签写着g =,文字大小为8,空格为索引hi腾出空间。并且hi的文字大小为6.现在我将它们一起移动以获得g下标hi。



这不起作用,因为有些用户有屏幕高清,分辨率1900x1025,...因为所有分辨率的空间不一样长。所以我不得不从2个标签变为3个:一个是g,第二个是=,第三个是hi并将它们组合在一起。这有效,但其中一些仍然在标签和其他标签之间有更多的空间。为什么?



是否有可能将一个标签粘合在另一个标签上?因此,如果标签被移动,带有索引的标签也随之移动。



p.s.相反,我必须使用一个标签3.

Label for ex.: "g_hi=" i wrote with two labels "g =" with text size 8, spaces to make room for index "hi". And "hi" with text size 6. And now i move them together to get "g" subscript "hi".

This did not work, because some users have screens HD, resolutions 1900x1025,... because spaces are not equally long in all resolutions. So i had to change from 2 labels to 3: one is "g", second is "=" and third is "hi" and put them together. This works, but still some of them are having more spaces between labels then others. Why?

Is it possible to "glue" one label on another? So if label is moved, label with index is moved also with him.

p.s. Instead one label i had to use 3.

推荐答案

正如您所见,使用标签执行此操作充满了问题。相反,试试这个:

在表单中添加一个RichTextBox,并设置以下属性:

Doing this with labels is fraught with problems, as you have seen. Instead, try this:
Add a RichTextBox to your form, and set the following properties:
ReadOnly      True
BorderStyle   None
MultiLine     False
Text          %%%



将控件调整为合理的控件,并将其添加到Form.Load事件:


Resize the control to a sensible one, and add this to your Form.Load event:

richTextBox1.Rtf = richTextBox1.Rtf.Replace("%%%", @"g\sub\dn1HL\nosupersub\up0=");

运行程序!


这篇关于标签上的标签,一个“胶合”标签。在其他方面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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