How do i set this window to topmost?

Posted by acidzombie24 on Stack Overflow See other posts from Stack Overflow or by acidzombie24
Published on 2010-06-09T20:22:39Z Indexed on 2010/06/09 20:32 UTC
Read the original article Hit count: 142

Filed under:
|
|

How do i set my window above all other? I need a bad but noticeable msg box that closes on its own. Msg is a dummy form which is empty. All i want is its title. The problems with the code is the window isnt created 0,0 (its just whereever windows feels like putting it). The width is correct but i notice if i click firefox or another app window my app doesnt pop up. I know it is being shown bc i can see it in the taskbar at the bottom for a brief second. So the bugs so far

  1. Doesnt go topmost if i click another app
  2. Isnt 0,0

How do i fix this?

            {
                var msg = new Msg();
                msg.Text = (has ? "*" : "+") + args[0];
                msg.TopMost = true;
                msg.Width = 2000;
                msg.Top = 0;
                msg.Left = 0;
                msg.Show();
                System.Threading.Thread.Sleep(1000);
                msg.Close();
            }

© Stack Overflow or respective owner

Related posts about c#

Related posts about .NET