p-Payroll / Payroll / frmTEAM.cs
frmTEAM.cs
Raw
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Payroll
{
    public partial class frmTEAM : Form
    {
        public frmTEAM()
        {
            InitializeComponent();
        }

        // Code to move form by simply clicking on it
        protected override void OnMouseDown(MouseEventArgs e)
        {
            base.OnMouseDown(e);
            if (e.Button == MouseButtons.Left)
            {
                this.Capture = false;
                Message msg = Message.Create(this.Handle, 0XA1, new IntPtr(2), IntPtr.Zero);
                this.WndProc(ref msg);
            }
        }
        // code ends here

        private void pictureBox2_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}