写了一个form1_MouseDown,鼠标在form1上移动不知道怎么没反映
private void Form1_MouseDown(object sender, MouseEventArgs e)
{
Point mouseDownLocation = new Point(e.X ,e.Y );
string eventString =null;
switch (e.Button)
{
case MouseButtons .Left :
eventString ="L";
break ;
case MouseButtons .Right :
eventString ="R";
break ;
case MouseButtons .Middle :
eventString ="M";
break;
case MouseButtons .XButton1 :
eventString = "X1";
break;
case MouseButtons .XButton2 :
eventString ="X2";
break;
default :
break;
}
if (eventString != null)
{
this.toolStripStatusLabel1.Text = "当前鼠标位置:" + eventString.ToString() + "鼠标落下位置" + mouseDownLocation.ToString(); }
else
{ this.toolStripStatusLabel1.Text = mouseDownLocation.ToString();
}
}
private void Form1_MouseDown(object sender, MouseEventArgs e)
{
Point mouseDownLocation = new Point(e.X ,e.Y );
string eventString =null;
switch (e.Button)
{
case MouseButtons .Left :
eventString ="L";
break ;
case MouseButtons .Right :
eventString ="R";
break ;
case MouseButtons .Middle :
eventString ="M";
break;
case MouseButtons .XButton1 :
eventString = "X1";
break;
case MouseButtons .XButton2 :
eventString ="X2";
break;
default :
break;
}
if (eventString != null)
{
this.toolStripStatusLabel1.Text = "当前鼠标位置:" + eventString.ToString() + "鼠标落下位置" + mouseDownLocation.ToString(); }
else
{ this.toolStripStatusLabel1.Text = mouseDownLocation.ToString();
}
}
解决方案 »
- ArcGIS 如何发布简单的GP服务?
- 谁那里有关于xml的所有操作方法,包括排序,增,删,改,查
- winform datagridview 如何实现多层表头
- 求解法!
- 寻求类似屏幕保护方式监测键盘鼠标是否有动作
- |zyciis| 200分求 在VS2003 WinFrom 中的 DataGrid 如何给他添加汇总 如何手动调节列的宽度
- 提问。。关于c/s的基础问题
- OracleCommand语句中使用like
- 关于异步socket实现telnet的封装问题,知道的老大门帮帮忙,分不够可以加。小弟谢先!
- 为什么 .net beta2中找不到 Sytem.Data.SQL namespace
- 如何用数据库中插入一条记录(所有字段的值都为空)
- Windows service 模板
this.MouseMove += new System.Windows.Forms.MouseEventHandler(this.Form1_MouseDown);
这句写错了啊.呵呵.分数给你了啊!
请问你这个是什么控件..怎么我找不到呢..
private void Form1_MouseDown(object sender, MouseEventArgs e)
求指教..