Hiya,
I have tried to follow the msdn article (http://msdn.microsoft.com/en-us/library/ms171548.aspx) on how to simulate mouse clicks. However, I don't understant it, or it doesn't do what I want it to do.
I want to simulate a mouse click on the form each time a particular event occurs (such as Form.Deactivate)
The way I understand this article it means to register and write a MouseClick event (handler):
OnMouseClick(Form1_MouseClick)
but this is obviously wrong. Can anyone help me? How do I now raise the Form1_MouseClick event in the code (i.e. without having to use a mouseclick)?
Thanks a lot,
Vic_code
I have tried to follow the msdn article (http://msdn.microsoft.com/en-us/library/ms171548.aspx) on how to simulate mouse clicks. However, I don't understant it, or it doesn't do what I want it to do.
I want to simulate a mouse click on the form each time a particular event occurs (such as Form.Deactivate)
The way I understand this article it means to register and write a MouseClick event (handler):
this.MouseClick += new MouseEventHandler(Form1_MouseClick);
void Form1_MouseClick(object sender, MouseEventArgs e)
{
textBox.Focus();
}
Then, I thought the article said to use something calledOnMouseClick(Form1_MouseClick)
but this is obviously wrong. Can anyone help me? How do I now raise the Form1_MouseClick event in the code (i.e. without having to use a mouseclick)?
Thanks a lot,
Vic_code