I have a TextBlock which is over a ComboBox and I want the combobox popup (dropdown) apear when I click on it.

<Grid>
    <ComboBox Name="tstcmb" Height="27" HorizontalAlignment="Left" Margin="29,92,0,0" VerticalAlignment="Top" Width="131"  SelectedIndex="1"  >
       <ComboBoxItem>a</ComboBoxItem>
       <ComboBoxItem>aaaa</ComboBoxItem>
    </ComboBox>
    <TextBlock Text="skdkdkdk" Background="Green" Height="16" HorizontalAlignment="Left" Margin="29,92,0,0" VerticalAlignment="Top" Width="131" />
</Grid>

Is it possible?

有帮助吗?

解决方案

Set IsHitTestVisible="False"

<TextBlock IsHitTestVisible="False".../>

In that way the TextBlock doesn't intercept mouse clicks and allows them to be handled by the ComboBox underneath.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top