WPF中控件显示问题,Z轴显示不对,控件被遮住了

ighack 2012-01-12 09:00:46
我在GroupBox控件中有一个ListBox
我想让ListBox显示在GroupBox之上,怎么设置都不对,能不能显示啊

<GroupBox Header="运输信息" Panel.ZIndex="5">

<StackPanel Orientation="Horizontal">
<Label Content="代单号:"></Label>
<TextBox Name="txtOrderid" Width="130" Height="20"></TextBox>
<Label Content="起点:" Margin="30,0,0,0"></Label>
<Canvas Width="130" Panel.ZIndex="7">

<TextBox Name="txtSstie" Width="130" Height="20" PreviewKeyUp="txtSstie_PreviewKeyUp"></TextBox>
<ListBox Name="lstSsite" Width="130" Margin="0,20,0,0" Height="70" Visibility="Collapsed" >
<ListBoxItem Content="sdfafdas" />
<ListBoxItem Content="asdfasdfasdfsa" />
<ListBoxItem Content="asdfadfasd" />
</ListBox>
</Canvas>
<Label Content="终点:"></Label>
<Canvas Width="130">
<TextBox Name="txtEstie" Width="130" Height="20"></TextBox>
<ListBox Name="lstEsite" Width="130" Margin="0,20,0,0" Visibility="Collapsed"></ListBox>
</Canvas>
<Label Content="运输方式:" Margin="30,0,0,0"></Label>
<ComboBox Name="cmbTranWay" Width="90"></ComboBox>
</StackPanel>
</GroupBox>


...全文
359 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
ighack 2012-09-05
  • 打赏
  • 举报
回复
[Quote=引用 4 楼 的回复:]

哎 用WPF来做这个界面......
[/Quote]

我也不想用WPF来做啊
ighack 2012-01-30
  • 打赏
  • 举报
回复
[Quote=引用 2 楼 qldsrx 的回复:]
listbox放外层,不要放在GroupBox里面,否则作为GroupBox的子控件,肯定不能跑到GroupBox的上层来。
[/Quote]
放在外面的话我怎么保证那个listbox正好在textbox的正下方呢
startstartsvip 2012-01-17
  • 打赏
  • 举报
回复
Canvas 里面的控件 z 才有效
qldsrx 2012-01-17
  • 打赏
  • 举报
回复
listbox放外层,不要放在GroupBox里面,否则作为GroupBox的子控件,肯定不能跑到GroupBox的上层来。
ighack 2012-01-17
  • 打赏
  • 举报
回复

现在显示是这样的,我不想listbox被遮住
Just4life 2012-01-17
  • 打赏
  • 举报
回复
哎 用WPF来做这个界面......

110,502

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧