Hi all,
I have created a form with a custom border, on selecting another program it calls a deactivate event that preforms the shading to make it look unselected, and the opposite when it is selected.
If however I run the program and while it is loading I chose another program so that it sits on top, my form has not actually loaded in this time and doesn't fire off a deactivate event making it look like an active window.
Basically I'm having trouble finding a way to test if my program is the active one and if so force the deactivate event.
Any help would be greatly appreciated,
Hayden
Loading
Suthish NairPosted Sep 28, 2010, 2:07 AM
Form.ActiveFormfora current active or top-level window.Form.ActiveMdiChild for an MDI child window.
sorry my reply, is not correct way for your query.
Hayden FisherPosted Sep 28, 2010, 1:34 AM
Thanks for the reply however I'm not sure it is that simple. I also have a splash screen that fades out when the form is displayed. Not sure if this is causing the value but TopMost always comes back as false.
I created an event triggered when the main form is first shown and output the TopMost value to a messagebox it always comes back as false. This occurs whether I have another application on top or not.
I have attached my full project so far and I have removed the above 'shown' event.
Regards Hayden
Mahesh ChandPosted Sep 27, 2010, 1:07 PM
if (this.TopMost == true)
// This is top most window