判断鼠标是否按下.

国手 2008-07-10 11:05:28
判断鼠标是否按下.
...全文
242 10 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
10 条回复
切换为时间正序
请发表友善的回复…
发表回复
cwb210 2008-07-10
  • 打赏
  • 举报
回复
不会 学习
gomoku 2008-07-10
  • 打赏
  • 举报
回复
You may use Control.MouseButtons to detect mouse button status.


public partial class Form1 : Form
{
Timer timer = new Timer();
public Form1()
{
InitializeComponent();
timer.Interval = 100;
timer.Start();

timer.Tick += delegate
{
string s = "";
switch (Control.MouseButtons)
{
case MouseButtons.Left: s = "Left"; break;
case MouseButtons.Middle: s = "Middle"; break;
case MouseButtons.Right: s = "Right"; break;
}
this.Text = s;
};
}
}
aaajedll 2008-07-10
  • 打赏
  • 举报
回复
學習,不會
z317149886 2008-07-10
  • 打赏
  • 举报
回复
如果是程序内就随便了,
随时监空用windows服务,
phper530 2008-07-10
  • 打赏
  • 举报
回复
其实也不会很模糊啊,首先它在C#里问的,那肯定是用C#表示的语法!

只是我不知道,不然一定会回答你的!
GhostAdai 2008-07-10
  • 打赏
  • 举报
回复
晕,这问题问得够模糊的了!
falx2004 2008-07-10
  • 打赏
  • 举报
回复
mouse.mousedown()
h_w_king 2008-07-10
  • 打赏
  • 举报
回复
if (MouseButtons == MouseButtons.Left)
MessageBox.Show("mouse left click ");
beancurd005 2008-07-10
  • 打赏
  • 举报
回复
同意6楼的方法

或者重写WndProc方法,也可以得到你的鼠标down/up的状态
清风水岸 2008-07-10
  • 打赏
  • 举报
回复
不错,试了一下6楼的可行啊。学习了

111,093

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • AIGC Browser
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧