zero-0
zero-0

Reputation: 33

Change location of a borderless form (C#)

How is it possible to move a borderless (FormBorderStyle.None) form out of window (= negative coordinates)?

I already tried the following things:

Any ideas?

Upvotes: 1

Views: 912

Answers (2)

Nuray Altin
Nuray Altin

Reputation: 1334

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;

Upvotes: 3

Hans Passant
Hans Passant

Reputation: 942368

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.

Upvotes: 1

Related Questions