Hello,

I have a C# App with no toolbar and no border. How can I make it
possible for the user to move the app if there is no title bar?

Thanks

RE: C# Moveable Window by JCauble

JCauble
Mon Jan 09 09:50:07 CST 2006

Here is one way to do it add this to your form. It basically tells windows
that your whole form acts like a titlebar.

// Let Windows drag this form for us
protected override void WndProc(ref Message m)
{
if (m.Msg == 0x0084 /*WM_NCHITTEST*/) {
m.Result= (IntPtr)2; // HTCLIENT
return;
}
base.WndProc(ref m);
}

"pocketbin@hotmail.com" wrote:

> Hello,
>
> I have a C# App with no toolbar and no border. How can I make it
> possible for the user to move the app if there is no title bar?
>
> Thanks
>
>

Re: C# Moveable Window by pocketbin

pocketbin
Mon Jan 09 10:13:07 CST 2006

Thanks for the code, but it still does not move the app. Any ideas why
this code is not working?


Re: C# Moveable Window by pocketbin

pocketbin
Mon Jan 09 10:21:23 CST 2006

I made it work. Thanks for the solution!


Re: C# Moveable Window by Herfried

Herfried
Mon Jan 09 11:26:37 CST 2006

<pocketbin@hotmail.com> schrieb:
> I have a C# App with no toolbar and no border. How can I make it
> possible for the user to move the app if there is no title bar?

Mick Doherty has a code sample on doing that on his website:

<URL:http://dotnetrix.co.uk/misc.html>
-> "Move a borderless form."

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>