这是不可能的autocompletebox.Focus()
,但似乎有一个解决方法:TextBox textBox = autoBox.Template.FindName("Text", autoBox) as TextBox;
但是,Windows Phone 中没有方法FindName
。我该如何解决这个问题?
这是不可能的autocompletebox.Focus()
,但似乎有一个解决方法:TextBox textBox = autoBox.Template.FindName("Text", autoBox) as TextBox;
但是,Windows Phone 中没有方法FindName
。我该如何解决这个问题?
从此博客中获取有关VisualTreeEnumeration的一小段源代码。(请注意关于 Toolkit 自己的 VisualTreeExtensions 类的注释不适用于 WP7 工具包)。
现在您可以使用以下方法检索内部文本框:-
textBox = autoBox.Descendents().OfType<TextBox>().FirstOrDefault(t => t.Name == "Text");