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
205 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

740 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