Link to home
Start Free TrialLog in
Avatar of gem56
gem56

asked on

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
ASKER CERTIFIED SOLUTION
Avatar of agriesser
agriesser
Flag of Austria image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of gem56
gem56

ASKER

Thanks for that aqriesser.
Avatar of gem56

ASKER

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