Solved

WPF App window.ShowDialog()

Posted on 2010-11-18
4
1,463 Views
Last Modified: 2012-08-13
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
Comment
Question by:brasso_42
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 29

Expert Comment

by:Gautham Janardhan
ID: 34170639
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
 
LVL 1

Author Comment

by:brasso_42
ID: 34171322
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
 
LVL 29

Accepted Solution

by:
Gautham Janardhan earned 500 total points
ID: 34171361
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
 
LVL 1

Author Closing Comment

by:brasso_42
ID: 34171372
Great thanks
0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
This article is the result of a quest to better understand Task Scheduler 2.0 and all the newer objects available in vbscript in this version over  the limited options we had scripting in Task Scheduler 1.0.  As I started my journey of knowledge I f…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

737 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question