选项卡项中的 WPF XAML Web 浏览器问题
我正在开发一个应用程序,其中涉及选项卡控件的选项卡项中的 Web 浏览器对象。
例子:
<Window x:Class="TabControl.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Height="350" Width="525">
<Grid>
<TabControl
x:Name="tabControl1">
<TabItem>
<TextBox>Hello</TextBox>
</TabItem>
<TabItem>
<WebBrowser Source="http://www.google.com"></WebBrowser>
</TabItem>
</TabControl>
</Grid>
因此,第一次单击网络浏览器选项卡时,焦点会转到谷歌中的搜索框,当您尝试返回第一个选项卡时,需要单击两次,我认为单击一次会将焦点从网页上移开,另一个移动选定的选项卡项目?任何人都可以提供一个建议,只需单击一下即可更改选项卡吗?干杯!
I am developing an application that involves a web browser object in a tab item of a tab control.
example:
<Window x:Class="TabControl.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Height="350" Width="525">
<Grid>
<TabControl
x:Name="tabControl1">
<TabItem>
<TextBox>Hello</TextBox>
</TabItem>
<TabItem>
<WebBrowser Source="http://www.google.com"></WebBrowser>
</TabItem>
</TabControl>
</Grid>
So, the first time you click on the web browser tab, the focus goes to the search box in google, when you try to go back to the first tab, it requires two clicks, one i assume to take the focus away from the webpage, and another to move the selected tab item? Can anyone offer a suggestion that would enable the tab to be changed with only one click? Cheers!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
为 tabControl1 添加 PreviewMouseLeftButtonDown 处理程序并将 tabControl1 设置为焦点。
Add a PreviewMouseLeftButtonDown handler for tabControl1 and set tabControl1 to focus.