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

Mahesh ChandRank #1 · 393.4K reputationPosted Sep 27, 2010, 9:07 AM EDT
if (this.TopMost == true)
// This is top most window
Hayden Fisher3 reputationPosted Sep 27, 2010, 9:34 PM EDT
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
Suthish NairRank #92 · 22.8K reputationPosted Sep 27, 2010, 10:07 PM EDT
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.