如题,刚入手c#,望多指教!万分感谢!

解决方案 »

  1.   

    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Windows.Forms;namespace aaaa
    {
        public partial class Form1 : Form
        {
            Point oldPoint;        public Form1()
            {
                InitializeComponent();
                oldPoint = new Point();
                this.FormBorderStyle = FormBorderStyle.None;
            }        private void Form1_MouseDown(object sender, MouseEventArgs e)
            {
                oldPoint.X = e.X;
                oldPoint.Y = e.Y;
            }        private void Form1_MouseMove(object sender, MouseEventArgs e)
            {
                if (e.Button == MouseButtons.Left)
                {
                    this.Left += (e.X - oldPoint.X);
                    this.Top += (e.Y - oldPoint.Y);
                }
            }        private void button1_Click(object sender, EventArgs e)
            {
                this.Close();
            }
        }
    }