문제

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