C# Moveable Window

  • Thread starter Thread starter pocketbin
  • Start date Start date
P

pocketbin

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
 
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);
}
 
Thanks for the code, but it still does not move the app. Any ideas why
this code is not working?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

How to make a floating toolbar 1
Need moveable toolstrip example code - New to Windows & C# 2
Question on Form Resize 4
No border style 2 2
Moveable Form 2
Windows 10 Itunes/TabKey 0
What are these please? 2
Windows 11 Windows 11 update 5

Back
Top