1、设置窗体TopMost属性
private DispatcherTimer timer; public Window1() { InitializeComponent(); Loaded += new RoutedEventHandler(Window1_Loaded); } void Window1_Loaded(object sender, RoutedEventArgs e) { timer = new DispatcherTimer(); timer.Interval = TimeSpan.FromSeconds(1); timer.Tick += timer1_Tick; timer.Start(); //.... //timer.Stop(); } private void timer1_Tick(object sender, EventArgs e) { //定时处理 this.TopMost = true; }
2、设置窗体Owner
WindowInteropHelper mianHanel = new WindowInteropHelper(MainWindow.Current); WindowInteropHelper vedioWin = new WindowInteropHelper(this); WindowInteropHelper FrameWin = new WindowInteropHelper(FrameWindow); FrameWin.Owner = IntPtr.Zero; mianHanel.Owner = vedioWin.Handle; vedioWin.Owner = FrameWin.Handle;
3、
时间: 2024-10-27 08:35:11