SearchBoxControl专注于在Win8.1上启动应用程序 [英] SearchBoxControl has focus on app launching on Win8.1

查看:181
本文介绍了SearchBoxControl专注于在Win8.1上启动应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的Windows 8.1应用程式中使用新的SearchBox控制项,但每次启动应用程式时,SearchBox都会显示焦点,并显示搜寻纪录。我试图将焦点设置在我的页面上的另一个控件,但它不工作。那么如何在不显示搜索记录的情况下启动我的应用程序?



谢谢。

解决方案

这是我的猜测。您尝试将焦点设置为网页上的其他内容,但实际上您的网页上没有其他可以接受程序化焦点的内容。要测试这个,只需添加< Button /> 到您的页面,并将焦点设置为。按钮是完美的这个测试,如< TextBox />



您有一些选择,您的选择会根据您的应用程式而有所不同:


  1. 将SearchBox设置为IsEnabled = false,直到出现Page.Loaded

  2. 将焦点设置在另一个控件上,例如< Button /> 即Width =1和Height =1

  3. 您可以在SearchBox上尝试TabStop =False







  4. b

    对不起,只是头脑风暴与你在这。我打赌,其中一个会做到。让我知道。



    运气最好。


    I'm using the new SearchBox Control in my Windows 8.1 app, but everytime I launch the app the SearchBox has the focus and displays the search history. I've tried to set the focus on another control on my page, but it doesn't work. So how can I start my app without showing the search history?

    Thanks.

    解决方案

    Here's my guess. You are attempting to set focus to something else on the page, but there's actually nothing else on your page that can accept a programmatic focus. To test this, simply add a <Button /> to your page and set the focus to that. Buttons are perfect for this test, as would be a <TextBox />. If this foxes the problem then you understand it.

    You have some options, and your choices will vary based on your app:

    1. Set the SearchBox to IsEnabled=false until the Page.Loaded is raised
    2. Set focus on another control, like a <Button /> that is Width="1" and Height="1"
    3. You might try TabStop="False" on the SearchBox, but that may not work
    4. Move the SearchBox further down the Logical Tree, the default Tab Stop is higher

    Sorry for just brainstorming with you on this. I bet one of those will do it. Let me know.

    Best of luck.

    这篇关于SearchBoxControl专注于在Win8.1上启动应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆