double click on a label in windows application
hi,
cud you pls tell me how can we chk, whether label cliked double times..i mean double click on a label in windows application...
thnaks in adv.
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Kirtan PatelPosted Oct 24, 2009, 10:34 AM
Here is Code For that
check "Do you like this answer" if it helps you :)
int ClickCount = 0;
private void Form1_Load(object sender, EventArgs e)
{
foreach (Control c in tableLayoutPanel1.Controls)
{
if (c is Label)
{
((Label)c).DoubleClick +=new EventHandler(Label_DoubleClick);
}
}
}
public void Label_DoubleClick(Object Sender,EventArgs e)
{
ClickCount++;
lblClickCount.Text = ClickCount.ToString();
}
Prakash SPosted Oct 24, 2009, 10:13 AM
Kirtan PatelPosted Oct 24, 2009, 10:10 AM
Just Write Code Like Below to in Label's Double Click Event Check Weather It Double Clicked or Not
private void label1_DoubleClick(object sender, EventArgs e)
{
MessageBox.Show("Label Doubule Clicked !!");
}
please check "Do you like this answer" if my answer helps you :)
if still need assistance then let me know :)