• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 210
  • Last Modified:

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

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
gem56
Asked:
gem56
  • 2
1 Solution
 
agriesserCommented:
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
 
gem56Author Commented:
Thanks for that aqriesser.
0
 
gem56Author Commented:
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

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

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