原文 WPF Popup 置顶问题 问题: 使用wpf的popup,当在popup中弹出MessageBox或者打开对话框的时候,popup总是置顶,并遮住MessageBox或对话框. 解决: 写如下用户控件 需导入的空间: using System.Windows.Controls.Primitives; using System.Runtime.InteropServices; using System.Windows.Interop; public class CCPopup : Pop
有时候在c++调用wpf控件的时候,wpf控件想自己显示窗体,但需要设置owner属性.迂回解决办法是设置wpf的window窗体的父窗体为进程的句柄. 1.获取当前进程id int id = Process.GetCurrentProcess().Id; 2.根据进程id获取进程主句柄 public static class ProcessHelper { private static class Win32 { internal const uint GwOwner = 4; interna
原文:WPF实现MDI窗体的方法 第一:新建一个类(Class) Win32Native.cs 代码如下: using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace WpfApplication1 { public class Win32Native { [System.Runtime.InteropServices.
原文:wpf无边框窗体移动和大小调整 using System; using System.Windows; using System.Windows.Interop; namespace Wpftest { public partial class MainWindow : Window { public MainWindow() { this.InitializeComponent(); // 在此点下面插入创建对象所需的代码. } protected override void OnS
问题一.popup总是置顶,遮挡其他窗口 最近发现popup设置打开后,总是会遮挡其他窗口,而我们只想让它仅仅在应用程序的上一层即可,并不像让它在最上面 解决方案是继承Popup重新定义控件PopupEx. public class PopupEx : Popup { public static DependencyProperty TopmostProperty = Window.TopmostProperty.AddOwner(typeof(PopupEx ), new FrameworkP