Click here to Skip to main content
15,899,313 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
supposing, we have a button:


i want by clicking it,at the same time: form and lable and textbox


events occure.
Posted
Comments
bhagirathimfs 29-May-12 5:11am    
Please explain briefly ....This much is not sufficient to answer your question.
Sandeep Mewara 29-May-12 5:31am    
Click event of a label, form?

Your question is not clear. Please elaborate.

You can't cause a Click even on a Form, and label and a TextBox without some fairly nasty coding.

Instead, set the handler methods to call a common routine, passing it the Control that "caused" the Click event - you can get this from the "sender" parameter.

When you want to simulate the Click event from all three objects, you just call the same method, handing it the three objects in turn.
 
Share this answer
 
hi.
You can set it like
in form load event...

C#
button1.Click += new EventHandler(button1_Click);
            textBox1.MouseClick += new MouseEventHandler(button1_Click);


  void button1_Click(object sender, EventArgs e)
        {
            
        }
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900