By
SplIce
If you want to make a borderless form and be able to move it with the mouse, heres how:
Step 1:
Add this to the
using list,
Code:
using Microsoft.Win32;
Step 2:
Add this to the
public frmTTMain()
Under InitializeComponent();
Code:
this.MouseDown += new MouseEventHandler(this.frmTTMain_MouseDown);
Step 3:
Add this
AFTER the
private void frmTTMain_Load
Code:
//API functions to move the form
public const int WM_NCLBUTTONDOWN = 0xA1;
public const int HTCAPTION = 0x2;
[DllImportAttribute("user32.dll")]
public static extern bool ReleaseCapture();
[DllImportAttribute("user32.dll")]
public static extern int SendMessage(IntPtr hWnd, int Msg, int wParam, int lParam);
public void frmTTMain_MouseDown(object sender, MouseEventArgs e)
{
//If the left mouse is pressed, release form for movement
if (e.Button == MouseButtons.Left)
{
ReleaseCapture();
SendMessage(Handle, WM_NCLBUTTONDOWN, HTCAPTION, 0);
}
I found this off of a site don't recall which.............