TextChange和焦点问题 [英] TextChange and focus problem
问题描述
我有一个简单的问题(我希望)。在我的网格视图中,我有一个文本框。当用户单击并与文本框交互时,TextChanged事件正在更新数据(在Enter和按下按钮上)。我的问题是用户决定再次编辑文本。按Enter键无效。我做了一些测试,发现当我关注其他控件并单击文本框时 - 文本会更新。我不知道TextChanged事件与聚焦控制有什么关系。我没有想法。
I have a simple problem (I hope). In my Grid view I have a text box. When user click and interact with text box TextChanged event is updating data (both on Enter and button press). My problem is when user decide to edit text again. Pressing enter is doing nothing. I did some testing and found out that when I focus some other control and click back on text box – text is updated. I didnt know TextChanged event has anything to do with focusing control. I am out of ideas.
推荐答案
您可以将gridview元素的
You can change your gridview element's
IsTabStop
属性更改为false以获得那个效果。
另外如果你想用Tab循环你可以
property to false to gain that effect.
Also if you want to cycle with Tab you can
TabNavigation="Cycle"
。
两次更改都在xaml中。
这是否会在所有浏览器中发生?
尝试设置IsTabStop属性 - http:/ /msdn.microsoft.com/en-us/library/system.windows.controls.control.istabstop.aspx [ ^ ]
这篇关于TextChange和焦点问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!