鼠标按右键是否一直按下,移过一排按钮取值。? 我现在要做的是鼠标按右键是否一直按下,移过一排按钮取值。 鼠标按下是在窗体上按下的。 不是控件。(C#) 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 C#.Net反射机制?Win32API 窗体句柄?控件集合?没做过~ 代码如下namespace WindowsFormsApplication1{ public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void Form1_MouseDown(object sender, MouseEventArgs e) { if (e.Button == MouseButtons.Left) this.MouseMove += new MouseEventHandler(Control_MouseMove); } void Control_MouseMove(object sender, MouseEventArgs e) { if (e.Button == MouseButtons.Left ) { Control c = ((Form)sender).GetChildAtPoint(e.Location); if ((Button)c==button1) textBox1.Text = "123"; } } }} 如何查看C#代码对应的CLR语句? jQuery编写一个弹出对话框 为什么总说INSERT INTO 语法错误 “/myweb”应用程序中的服务器错误。 VS2003装了后,再装上VS2005,然后VS2003就建立不了项目了!大家帮忙解决一下 这个在C#如何写? 请教:如何做一个类似监视窗口的功能监控程序中各个变量的值??? 如何在winForm中加载UserControl ,急呀!请指教! Visual studio2012中如何自动生成代码?? SQL语句@%问题 哪里有.net类库的详细说明(电子版)? 怎么通过串口读取硬件上的值。 请推荐一本多几本好的C#网络编程的书籍,谢谢
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
} private void Form1_MouseDown(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Left)
this.MouseMove += new MouseEventHandler(Control_MouseMove);
} void Control_MouseMove(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Left )
{
Control c = ((Form)sender).GetChildAtPoint(e.Location);
if ((Button)c==button1)
textBox1.Text = "123";
}
}
}
}