How do you simulate Mouse Click in C#?

后端 未结 7 902
长情又很酷
长情又很酷 2020-11-22 05:34

How do you simulate Mouse clicks in C# winforms applications?

7条回答
  •  北海茫月
    2020-11-22 06:23

    I use the InvokeOnClick() method. It takes two arguments: Control and EventArgs. If you need the EventArgs, then create an instance of it and pass it in, else use InvokeOnClick(controlToClick, null);. You can use a variety of Mouse event related arguments that derive from EventArgs such as MouseEventArgs.

提交回复
热议问题