可编辑标签控件 [英] Editable Label Controls

查看:95
本文介绍了可编辑标签控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人知道我如何创建可编辑标签控件吗?我需要我的用户能够编辑标签(还可以更改其样式信息的一部分),但是在网上找不到任何有用的信息.

Does anybody know how I could go about creating an Editable Label Control? I need my users to be able to Edit Labels (Also change parts of its style info), but have found no helpful info anywhere online.

任何帮助,我们都会感激

Any help at all is appreciated

谢谢

推荐答案

您可以创建一个自定义控件(需要一些工作).该控件可以在内部具有标准的标签控件,并且当用户单击标签(或以某种方式进入编辑模式)时,您可以实例化文本框控件并将其显示在标签控件所在的位置.因此,用户将获得标签控件被转换"为文本框的错觉.用户可以在文本框中编辑标签文本,编辑完成后,您要做的就是隐藏文本框并将更改应用于标签文本.

You can create a custom control (requires some work). The control can have a standard label control internally and when the user clicks the label (or goes to the editing mode somehow) you can instantiate a textbox control and show it where the label control was. So the user would get the illusion of the label control being "converted" to a textbox. The user can edit the label text in the textbox and when the editing finished, all you have to do is hide the textbox and apply the changes to the label text.

如果还需要编辑样式,则必须显示一个面板,上面带有所有可编辑的设置,而不是一个文本框.

If you need to edit styles as well, you will have to display a panel with all the editable settings on it instead of a one single textbox.

这篇关于可编辑标签控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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