Move able solution with no border

Rage

Former Staff
Jun 5, 2015
184
71
38
rmzmodshop.com
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


Code:
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...


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 !!
 
  • Like
Reactions: Jet

Cyb3r

RG Admin
RG Admin
Feb 21, 2015
1,657
853
123
Actually I was looking for this once, it might be useful later, thanks mate and keep it up! :D
 

Rage

Former Staff
Jun 5, 2015
184
71
38
rmzmodshop.com
Good stuff mate!
Actually I was looking for this once, it might be useful later, thanks mate and keep it up! :D
No problem, this was actually something that I have had for some time now which I knew was out there but it was not easy to find so I decided to share it here, just hoping to see some unique styled programs get released other than the same looking tools that do the same functions lol