由网友(用二逼挥霍青春i)分享简介:如何将焦点设置在WPF的文本框元素How to set the focus on an TextBox element in WPF我有这个code:txtCompanyID.Focusable = true;txtCompanyID.Focus();...但它不能正常工作。...but it is not...
如何将焦点设置在WPF的文本框
元素
How to set the focus on an TextBox
element in WPF
我有这个code:
txtCompanyID.Focusable = true;
txtCompanyID.Focus();
...但它不能正常工作。
...but it is not working.
你知道吗?
推荐答案
在XAML:
<StackPanel FocusManager.FocusedElement="{Binding ElementName=Box}">
<TextBox Name="Box" />
</StackPanel>
相关推荐
最新文章