将附加属性添加到现有控件 [英] Add Attach Property to Existing Control

查看:31
本文介绍了将附加属性添加到现有控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想向按钮控件添加一个属性,例如描述",我在工具提示中使用它.如何向控件添加属性?

I want to add a Property such as 'Description' to Button control, that i use it in Tooltip. how can i add a property to a control?

推荐答案

您可以使用按钮上的 Tag 属性,即 Object 类型,您可以根据需要在其中存储描述文本.

You can use the Tag propery on the button, that is of the type Object and you can store a description text in it if you like.

这篇关于将附加属性添加到现有控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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