积极答复者
文本框设置为URL输入时,键盘有一个向右的箭头,怎么实现按这个箭头,就触发相应的事件呢??????/??

问题
答案
-
你好,
>>一个向右的箭头
这个就是enter键,请使用Textbox的keydown事件,比如:
private void TextBox_KeyDown_1(object sender, System.Windows.Input.KeyEventArgs e) { if (e.Key == Key.Enter) { MessageBox.Show("enter"); } }
>>Textbox输入内容时,按回车键不能换行?为什么?
默认确实是不会换行,但是可以通过设置AcceptsReturn属性为True就会换行的,请参考:
http://shareourideas.com/2011/01/10/multiline-textbox-in-windows-phone-7/
Mark Yu - MSFT
MSDN Community Support | Feedback to us
Develop and promote your apps in Windows Store
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
- 已编辑 iwpfModerator 2013年3月6日 10:15
- 已标记为答案 cctvgh 2013年3月6日 14:28
全部回复
-
你好,
>>一个向右的箭头
这个就是enter键,请使用Textbox的keydown事件,比如:
private void TextBox_KeyDown_1(object sender, System.Windows.Input.KeyEventArgs e) { if (e.Key == Key.Enter) { MessageBox.Show("enter"); } }
>>Textbox输入内容时,按回车键不能换行?为什么?
默认确实是不会换行,但是可以通过设置AcceptsReturn属性为True就会换行的,请参考:
http://shareourideas.com/2011/01/10/multiline-textbox-in-windows-phone-7/
Mark Yu - MSFT
MSDN Community Support | Feedback to us
Develop and promote your apps in Windows Store
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
- 已编辑 iwpfModerator 2013年3月6日 10:15
- 已标记为答案 cctvgh 2013年3月6日 14:28
-
楼上威武!!!Mark Yu - MSFT ,谢谢,非常感谢,问题得到解决了!!