3
當我們選擇WindowsFormHost中的任何TreeNode,然後嘗試在彈出窗口中顯示的文本框中鍵入文本時,由於焦點不會從TreeNode中丟失,因此不允許添加文本。我能得到這個建議嗎?鍵盤焦點在彈出框內添加的文本框中不工作
代碼段:
<Window x:Class="WpfApplication2.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:wind="clr-namespace:System.Windows.Forms;assembly=System.Windows.Forms"
Title="MainWindow" Height="350" Width="525">
<Grid>
<Popup Width="250" Height="300" StaysOpen="True" IsOpen="True">
<TextBox Width="100" Height="100"/>
</Popup>
<WindowsFormsHost Width="200">
<wind:TreeView>
<wind:TreeView.Nodes>
<wind:TreeNode Text="Node 1"/>
<wind:TreeNode Text="Node 2"/>
<wind:TreeNode Text="Node 3"/>
<wind:TreeNode Text="Node 4"/>
</wind:TreeView.Nodes>
</wind:TreeView>
</WindowsFormsHost>
</Grid>
</Window>
示例鏈接:
http://www.syncfusion.com/downloads/Support/DirectTrac/85553/WpfApplication21123581705.zip