Want to check whether a label is clicked or not in windows application.
hi,
want to check whether a label is clicked or not in windows application.how can we do it...help required...
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Kirtan PatelRank #292 · 8.6K reputationPosted Oct 24, 2009, 5:50 AM EDT
Just Write Code Like Below to Check Weather It Clicked or Not
private void label1_Click(object sender, EventArgs e)
{
MessageBox.Show("Label Clicked !!");
}
please check "Do you like this answer" if my answer helps you :)
if still need assistance then let me know :)
Kirtan PatelRank #292 · 8.6K reputationPosted Oct 24, 2009, 6:26 AM EDT
Then Here is Code For it
please 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).Click +=new EventHandler(Label_Click);
}
}
}
public void Label_Click(Object Sender,EventArgs e)
{
ClickCount++;
lblClickCount.Text = ClickCount.ToString();
}