MSDN中的内容: A Label participates in the tab order of a form, but does not receive focus (the next control in the tab order receives focus). For example, if the UseMnemonic property is set to true, and a mnemonic character—the first character after an ampersand (&)—is specified in the Text property of the control, when a user presses ALT+ the mnemonic key, focus moves to the next control in the tab order.
可是程序运行lable的text确实是aaa呢?
可是程序运行lable的text确实是aaa呢?
不管转义的事,winform 下是吧,应该不会出现这种问题
可是程序运行lable的text确实是aaa呢?
不管转义的事,winform 下是吧,应该不会出现这种问题
嗯,vs2010 winform 代码如下: private void button1_Click(object sender, EventArgs e)
{
string s = "aaa";
s += "&";
label1.Text = s;
}运行结果:
按照你的思路,我加了一个textbox,结果如下:真是奇怪
s += @"&";
label1.Text = s;
加一个: @ 看看。
A Label participates in the tab order of a form, but does not receive focus (the next control in the tab order receives focus). For example, if the UseMnemonic property is set to true, and a mnemonic character—the first character after an ampersand (&)—is specified in the Text property of the control, when a user presses ALT+ the mnemonic key, focus moves to the next control in the tab order.