在c#中用&符号传递控件文本有什么区别? [英] What is the difference in passing text of controls with ampersand in c#?

查看:62
本文介绍了在c#中用&符号传递控件文本有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

this.button1.text = "&Close";
this.button1.text = "Close";





两者都会动态显示文本为Close,那么传递&符号的用途是什么。



Both will display the text dynamically as Close, then what is the use of passing ampersand .

推荐答案

this.button1.text =& Close;

将强调C字与文本。它用于热键(快捷键,如果我没记错的话。你可以谷歌吧。)



this.button1.text =关闭;

只会分配文字。



-KR
this.button1.text = "&Close";
will underline the C word with the text. It's used for hotkeys (short cut keys, if I recall correctly. You can google for it.)

this.button1.text = "Close";
will simply assign the text.

-KR


这篇关于在c#中用&符号传递控件文本有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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