C#/Always On Top

Advertisement


Question
Hello,

 I have a form in my application (other than the main form). I want this form to be AlwaysOnTop; i.e. On top of all of the forms on the desktop, regardless of the parent of the forms (not only the forms of my application, but also forms of other running application. Just like the Windows Task Manager.

How can I make such a form, in my application?

thank you very very much.

Answer
hi

Here is the sample code

 frmMdiChild child1=new frmMdiChild();
   child1.MdiParent=this;
   child1.Show();

   frmMdiChild child2=new frmMdiChild();
   child2.MdiParent=this;
   child2.Show();

   frmAlwaysOnTop topform=new frmAlwaysOnTop();
   topform.Show();
   SetParent((int)topform.Handle,(int)this.Handle);  <<< Here is the Magic :-)


Happy Programming!!

-Srini

C#

All Answers


Answers by Expert:


Ask Experts

Volunteer


Srini Nagarajan

Expertise

can answer any kind of questions in ASP.NET, C#, VB.NET, ASP, SharePoint 2007, Coldfusion, Powerbuilder 7.00 / 8.00, JAVA servlets, MS SQL 2000 / MSSQL7, Sybase

Experience

Contact me if you need any custom development on ASP.NET, ASP, Coldfusion, Powerbuilder

©2012 About.com, a part of The New York Times Company. All rights reserved.