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
200 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
  • 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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

In my previous article (http://www.experts-exchange.com/Programming/Languages/.NET/.NET_Framework_3.x/A_4362-Serialization-in-NET-1.html) we saw the basics of serialization and how types/objects can be serialized to Binary format. In this blog we wi…
For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

757 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now