开发者

Change location of a borderless form (C#)

How is it possible to move a borderless (For开发者_如何学GomBorderStyle.None) form out of window (= negative coordinates)?

I already tried the following things:

  • this.Location = new Point(-10, -10);
  • MoveWindow() from user32.dll
  • SetWindowPos() from user32.dll

Any ideas?


The answer is; ( which not works under multi monitors)

this.Location = new Point(-1 * this.Width, -1 * this.Height);

You may hide your window by setting;

this.Visible = false;


Once you created a task bar out of your window with SHAppBarMessage, the window's location is controlled by the shell, depending on what edge you selected. You need to use either ABM_REMOVE, which destroys the task bar completely, or ABM_SETSTATE which lets you change it to an auto-hide task bar. Moving another window on top of the task bar doesn't work, the shell prevents it to allow a task bar to behave like, well, a task bar.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜