So I wrote this tutorial and was almost done but then clicked "delete" on my computer and instead of deleting anything it went back to a previous screen and deleted everything so I am redoing this all over again !!
This tut is meant to help those who want to create there own border, don't want a border, or just want there whole form to be able to be clicked and moved !!
Lets get started !
Step 1.) You need to add the following under the start of your form
ex. Gyazo - feadd0eacf0a630790ceda31fc8aeb04.png
public static string Status; public static string MemStatus; public const int WM_NCLBUTTONDOWN = 0xA1; public const int HT_CAPTION = 0x2; [DllImportAttribute("user32.dll")] public static extern int SendMessage(IntPtr hWnd, int Msg, int wParam, int lParam); [DllImportAttribute("user32.dll")] public static extern bool ReleaseCapture();
Step 2.) Select your move ables and find its properties
ex. I will be using pictureBox4 (I set it to the background so my title and icons still show)
Step 3.) Under your pictureBox (or other items) "Properties" you need to click the Lightning Bolt icon
Step 4.) Now you need to scroll down and find "MouseDown" and double click it
Step 5.) Now you will be taken to the code for your program
There you will add the following code...
{ if (e.Button == MouseButtons.Left) { ReleaseCapture(); SendMessage(Handle, WM_NCLBUTTONDOWN, HT_CAPTION, 0); } }
Now you are done !!
If you wish to also add the move able feature to your title and icons you can simply by going to the items properties and finding "MouseDown" and clicking the arrow and click the item that appears there
(should look like "pictureBox_MouseDown")
Enjoy and hope to see some unique tools get released !!