【发布时间】:2013-08-03 23:43:04
【问题描述】:
我有两个组合框,一个接一个。如果您打开包含此组合框的表单并避免将鼠标悬停在下部组合框上,则会出现问题,您只需单击第一个组合框并从下拉列表中选择位于第二个组合框正上方的项目。单击某个项目后,下拉列表将关闭,但您的鼠标将停留在第二个组合框上。但是这个组合框根本不会突出显示并对您的点击做出反应。请看这张照片:
两个组合框IsEditable = false; 但是,如果您将鼠标移出第二个组合框并返回到它 - 一切都会正常工作。请帮我解决这个问题。
UPD。 XAML:
<ComboBox Background="{x:Null}" Height="33" HorizontalAlignment="Left" IsEditable="False" IsEnabled="True" Margin="10,151,0,0" Name="comboBox2" VerticalAlignment="Top" Width="239" VerticalContentAlignment="Center" FontSize="14" IsReadOnly="False" Text="" SelectionChanged="comboBox2_SelectionChanged" TabIndex="6" HorizontalContentAlignment="Left" Padding="10,3" FontWeight="SemiBold" AllowDrop="False" Cursor="Hand" IsTabStop="True" />
<ComboBox Background="{x:Null}" FontSize="14" Height="33" HorizontalAlignment="Left" IsEditable="False" IsEnabled="True" Margin="10,190,0,0" Name="comboBox3" VerticalAlignment="Top" VerticalContentAlignment="Center" Width="439" IsReadOnly="False" Text="" SelectionChanged="comboBox3_SelectionChanged" TabIndex="8" HorizontalContentAlignment="Left" Padding="10,3" FontWeight="SemiBold" ClipToBounds="False" Cursor="Hand" IsHitTestVisible="True" SnapsToDevicePixels="True" UseLayoutRounding="True" />
【问题讨论】:
-
请查看更新的 XAML。它们不是习俗。填充了 xml 数据。最重要的是 - 您应该避免在表单加载后立即将鼠标悬停在第二个组合框上。