积极答复者
wpf中"_"有什么作用呢?

问题
答案
-
键盘快捷键吧,如果是按钮的话,就可以通过按Alt + "_" 前面的一个字母来操作.
- 已标记为答案 Sheldon _XiaoModerator 2010年11月15日 9:34
-
您好 zhzhzh
Jeremy liu 说的是对的,WPF中的"_"字符是用来设置快捷键用的,比如下面的代码 你就可以在 Label 上设置快捷键,然后使用 ALT + "W" 对 TextBox 直接进行输入,不用点击。
<Label Target="{Binding ElementName=nameText}" Content="_Write"></Label>
<TextBox Name="nameText"></TextBox>
如果把 Label 换成 Button,那么你使用ALT+"*",就会触发Button的点击事件。
Best regards,
Sheldon _Xiao
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Welcome to the All-In-One Code Framework!- 已标记为答案 Sheldon _XiaoModerator 2010年11月15日 9:34
全部回复
-
键盘快捷键吧,如果是按钮的话,就可以通过按Alt + "_" 前面的一个字母来操作.
- 已标记为答案 Sheldon _XiaoModerator 2010年11月15日 9:34
-
您好 zhzhzh
Jeremy liu 说的是对的,WPF中的"_"字符是用来设置快捷键用的,比如下面的代码 你就可以在 Label 上设置快捷键,然后使用 ALT + "W" 对 TextBox 直接进行输入,不用点击。
<Label Target="{Binding ElementName=nameText}" Content="_Write"></Label>
<TextBox Name="nameText"></TextBox>
如果把 Label 换成 Button,那么你使用ALT+"*",就会触发Button的点击事件。
Best regards,
Sheldon _Xiao
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Welcome to the All-In-One Code Framework!- 已标记为答案 Sheldon _XiaoModerator 2010年11月15日 9:34