[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1475
  • Last Modified:

WPF App window.ShowDialog()

Hi

I have an app which has a button that opens a second window and disables the window that opened it.  

This works fine, but if I browse away from the app and then click on it again in the task bar the disabled window appears ontop of the new window.

How can I get it to display the correct window when the app is clicked in the task bar.

My code so far is very simple:

Dim window As New Window2
window.ShowDialog()

Thanks
Brasso
0
brasso_42
Asked:
brasso_42
  • 2
  • 2
1 Solution
 
Gautham JanardhanCommented:
you can set the AlwaysOnTop property of the child window to true. also when doing window.ShowDialog() if you are doing this from the parent window do this instead window.ShowDialog(this)
0
 
brasso_42Author Commented:
Hi

I used Topmost="True" and that worked a treat.  I dont understand the w.dow.showdialog(this) bit though.  

this -- is not recognised.  what differance does that make?

Thanks brasso
0
 
Gautham JanardhanCommented:
ohhh vb.. forgot that it's me i think instead of this.
window.ShowDialog(me).. what it does is it tells that window 2's parent is current window
0
 
brasso_42Author Commented:
Great thanks
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now