Solved

When I run my application the Main window is shown behind the folder from where I invoked it

Posted on 2008-06-22
3
206 Views
Last Modified: 2010-04-23
Hi,
When I double click my application in a folder, it is shown behind the actual folder where it resides. I was expecting it to be automatically placed in the foreground.

Any ideas as to what's happening and how to resolve it?

/Michael
0
Comment
Question by:gem56
[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
3 Comments
 
LVL 14

Accepted Solution

by:
agriesser earned 250 total points
ID: 21841159
Have you applied the "modal" flag to your applications main window?
Just in case...

You could also specify the modal option in the code, just replace your

form1.show()

with

form1.show(modal)   // or "vbmodal"
0
 

Author Comment

by:gem56
ID: 21842996
Thanks for that aqriesser.
0
 

Author Comment

by:gem56
ID: 21843023
For the benefit of anyone else that comes across the same problem.

After accepting the solution I again got some odd things happening and found the real problem to be related to a 'MessageBox.Show' statement that was done just prior to the Form.Show statement, that I thought was my problem.

When implementing that bit of code I copied a previously used 'MessageBox.Show' statement that had 'MessageBoxOptions.ServiceNotification' option. Having that option in my statement was causing a Desktop folder to be placed in front of the dialog shown by 'Show = Me.SystemOptionsForm.ShowDialog()' statement.

After removing the MessageBoxOptions parameter all started working OK. When I think about it now, I'm not sure why I used that option in my statements in the first place. I guess it would have been another copy/paste!!!!

Cheers
     /Michael


0

Featured Post

Stressed Out?

Watch some penguins on the livecam!

Question has a verified solution.

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

This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
Come and listen to Percona CEO Peter Zaitsev discuss what’s new in Percona open source software, including Percona Server for MySQL (https://www.percona.com/software/mysql-database/percona-server) and MongoDB (https://www.percona.com/software/mongo-…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…

688 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