Simple Application for sending Keystroke in VB.NET

前端 未结 2 702
-上瘾入骨i
-上瘾入骨i 2020-12-12 06:55

I have an issue regarding Sendkeys Class, as i want to use this class in order to send some keystroke to the active application. As a first step i want to test the {Enter} k

2条回答
  •  再見小時候
    2020-12-12 07:30

    Button has focus. Button click event sends an enter keystroke. Sending an enter causes the button click event to fire. Infinite loop.

    You could disable the button before and re-enable the button after the sendkeys routine is done to stop the infinite loop.

    What you probably would want to do is switch the focus back to the application you want to send your keystrokes to.

提交回复
热议问题