Form.MouseDown
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.Drawing.Drawing2D;
public class Form1 : System.Windows.Forms.Form{
public Form1() {
InitializeComponent();
}
private void InitializeComponent() {
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(292, 273);
this.Name = "Form1";
this.Text = "Form1";
this.MouseDown += new System.Windows.Forms.MouseEventHandler(this.Form1_MouseDown);
}
static void Main() {
Application.Run(new Form1());
}
private void Form1_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e) {
Console.WriteLine("Mouse down");
}
}
Related examples in the same category