在WPF中的网格中显示对其他控件的控件 [英] Displaying a control over other controls in a grid in WPF
问题描述
我正在开发WPF应用程序.
主窗口的子控件包含在网格中.
最下面一行包含一个状态栏.
I am developing a WPF application.
Main window's child controls are contained in a grid.
The bottom row contains a status bar.
应用程序必须通知用户.
我想以编程方式在主窗口右下角的用户控件中显示通知.
我希望通知用户控件显示在状态栏和上一行的控件上.
The application must notify the user.
I want to programmatically display a notification in a user control in the bottom right corner of the main window.
I want the notification user control to be displayed over the status bar and the control in the above row.
如何显示网格中包含的其他控件的控件?
任何帮助将不胜感激
How can I display a control over other controls contained in a grid ?
Any help will be greatly appreciated
推荐答案
我已经解决了我的问题.
我已经修改了主窗口的XAML标记.
我已经在新网格的同一单元中声明了通知用户控件和包含主窗口的子控件的网格.
I have solved my problem.
I have modified the main window's XAML markup.
I have declared the notification user control and the grid containing main window's child controls in the same cell of a new grid.
我已经在通知用户控件的开始标记中设置了一些属性:
I have set some properties in the notification user control's opening tag :
- Grid.ZIndex ="1"
- HorizontalAlignment =右"
- VerticalAlignment =底部"
- Margin ="0 0 20 20"
当显示通知用户控件时:
When the notification user control is visible :
- 通知用户控件位于包含主窗口的子控件的网格上
- 通知用户控件位于主窗口的右下角
这篇关于在WPF中的网格中显示对其他控件的控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!