110,535
社区成员
发帖
与我相关
我的任务
分享
int clickCount=0;
private void xxx_MouseClick(object sender, MouseEventArgs e)
{
clickCount += e.Clicks; // 点击次数
}
}
是不是这意思
public partial class Form2 : Form
{
int i = 0;
public Form2()
{
InitializeComponent();
}
private void Form2_Load(object sender, EventArgs e)
{
TextBox txt = new TextBox();
txt.Text =string.Format( "点击了{0}次",i);
this.Controls.Add(txt);
this.Click += delegate {
i++;
txt.Text = string.Format("点击了{0}次", i);
};
foreach (Control c in this.Controls)
{
c.Click += delegate {
i++;
txt.Text = string.Format("点击了{0}次", i);
};
}
}
}
private void xxx_MouseClick(object sender, MouseEventArgs e)
{
int clickCount = e.Clicks; // 点击次数
}