【发布时间】:2015-08-30 15:24:30
【问题描述】:
在 WPF 表单中,我有一个扩展器,可以在其他控件(例如按钮)之上扩展:
<Expander Grid.Row="0" Panel.ZIndex="99" Name="searchMenuExpander" Header="Search menu" FontWeight="Bold" HorizontalAlignment="Stretch" Margin="10,10,0,0" MinWidth="510" MinHeight="200" VerticalAlignment="Top" Foreground="MidnightBlue" Cursor="Arrow">
<Grid Background="White">
<Border HorizontalAlignment="Stretch" VerticalAlignment="Stretch" />
<TextBlock Text="Name" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="20,10,0,0" Width="65" Height="20" Cursor="Arrow" />
<TextBox Name="nameSearchTextBox" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="115,10,0,0" Width="100" Height="20"/>
</Grid>
</Expander>
<Button Content="Button" Height="34" Width="85"/>
我的问题是扩展器后面的控件不再可点击,即使扩展器未展开也是如此。怎么了?我怎样才能摆脱这个错误?
【问题讨论】:
-
包裹
Expander的父控件是什么? -
按钮的画布定位的目的是什么?
-
父控件只是一个网格。忘记画布,它是更大代码的一部分,但在这里无关紧要。我编辑了我的问题以将其删除
标签: wpf xaml clickable expander