我在TabItem中有一个ComboBox。 问题是,当我选择任何ComoboxItem时,TabControl_SelectionChanged事件被触发。并且我在该事件内部有一些函数,我不希望它在我更改ComboBox选定项目后执行。ComboBoxItem选择触发TabControl_SelectionChanged事件
<TabControl x:Name="tb" HorizontalAlignment="Left" Height="299" Margin="10,10,0,0" VerticalAlignment="Top" Width="497" SelectionChanged="TabControl_SelectionChanged">
<TabItem x:Name="tbi1" Header="TabItem">
<Grid Background="#FFE5E5E5">
<Label x:Name="lbl" Content="Label" Margin="196,86,172,148"/>
<ComboBox HorizontalAlignment="Left" Margin="51,162,0,0" VerticalAlignment="Top" Width="120">
<ComboBoxItem Content="ComboBoxItem"/>
<ComboBoxItem Content="ComboBoxItem"/>
<ComboBoxItem Content="ComboBoxItem"/>
</ComboBox>
</Grid>
</TabItem>
<TabItem x:Name="tbi2" Header="TabItem">
<Grid Background="#FFE5E5E5"/>
</TabItem>
</TabControl>
编辑: 此外,我面对徘徊在标签项中的任何控制,因为它游动的TabItem过这个问题。
谢谢..但与徘徊在TabItem的任何控制也发生。 我应该处理我的标签控件中的所有文本框和组合框..他们可能是数百.. – Hassanation
@Hassanation我已经更新了我的答案。 –