Also add this bit of code to your form so that it can still be dragged.
Just add it right before the constructor (a method that calls InitializeComponent ()
private const int WM_NCHITTEST = 0x84; private const int HTCLIENT = 0x1; private const int HTCAPTION = 0x2;
This code: https://jachman.wordpress.com/2006/06/08/enhanced-drag-and-move-winforms-without-having-a-titlebar/
Now, to get rid of the title bar, but still have a border, combine the code with another answer:
this.ControlBox = false;
this.Text = String.Empty;
with this line:
this.FormBorderStyle = FormBorderStyle.FixedSingle;
Put these 3 lines of code on the OnLoad form, and you should have a nice floating form that can be dragged using a thin border (use FormBorderStyle.None if you don't want a border).
coding_is_fun Feb 08 '15 at 4:29 2015-02-08 04:29
source share