我试图通过ErrorProvider设置一个包含符号的错误消息。第一次尝试是这样的:
errorProvider.SetError(someControl, "You have not accepted the Terms & Conditions");这不显示符号字符。谷歌建议如下:
errorProvider.SetError(someControl, "You have not accepted the Terms &&& Conditions");它工作(即显示一个符号),但我想了解它为什么工作。有什么想法吗?
编辑:对于System.Windows.Forms.Label控件,有一个名为: UseMnemonic的属性,可以设置为False。ErrorProvider有这样的东西吗?
发布于 2011-09-16 06:45:05
“&”是一种特殊的字符,它的意思是在下面的字符下划线。所以如果你像这样使用它:
myButton.Text = "&Close";它将强调'C‘字符,这也将成为一个热键。如果您不希望这种情况发生,您可以在文本中使用“&”之类的双符号。
https://stackoverflow.com/questions/7441032
复制相似问题