MainForm.cs
上传用户:linger1010
上传日期:2008-12-08
资源大小:561k
文件大小:1k
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Text;
- using System.Windows.Forms;
- namespace MouseEvents
- {
- public partial class MainForm : Form
- {
- public MainForm()
- {
- InitializeComponent();
- }
- private void m_addMessage(string e, string x, string y, string button)
- {
- ListViewItem item = new ListViewItem(new string[] { e, x, y, button });
- m_lstMessage.Items.Add(item);
- }
- private void MainForm_Click(object sender, EventArgs e)
- {
- m_addMessage("Click", "-", "-", "-");
- }
- private void MainForm_DoubleClick(object sender, EventArgs e)
- {
- m_addMessage("DoubleClick", "-", "-", "-");
- }
- private void MainForm_MouseDown(object sender, MouseEventArgs e)
- {
- m_addMessage("MouseDown", e.X.ToString(), e.Y.ToString(), e.Button.ToString());
- }
- private void MainForm_MouseMove(object sender, MouseEventArgs e)
- {
- m_addMessage("MouseMove", e.X.ToString(), e.Y.ToString(), e.Button.ToString());
- }
- private void MainForm_MouseUp(object sender, MouseEventArgs e)
- {
- m_addMessage("MouseUp", e.X.ToString(), e.Y.ToString(), e.Button.ToString());
- }
- }
- }