How to make a WPF window be on top of all other windows of my app (not system wide)?

后端 未结 19 3019
南笙
南笙 2020-12-14 05:42

I want my window to be on top of all other windows in my application only. If I set the TopMost property of a window, it becomes on top of all windows of al

19条回答
  •  悲哀的现实
    2020-12-14 06:10

    In the popup window, overloads the method Show() with a parameter:

    Public Overloads Sub Show(Caller As Window)
        Me.Owner = Caller
        MyBase.Show()
    End Sub
    

    Then in the Main window, call your overloaded method Show():

    Dim Popup As PopupWindow
    
    Popup = New PopupWindow
    Popup.Show(Me)
    

提交回复
热议问题