Author Topic: Click event  (Read 6732 times)

0 Members and 1 Guest are viewing this topic.

Offline Juanjogomez

  • Forum Regular
  • Posts: 117
    • View Profile
Click event
« on: February 03, 2021, 05:56:15 am »
Hi,
How can a click event be generated by pressing a key?

I am doing my first form and I am lost
I have a form in which there are buttons with numbers (like a numeric keyboard). With the mouse and the click event I do what I need, but I also want to do it with the numeric keyboard, and it has occurred to me, in order not to duplicate code, that with the KeyPress event of the key 1 (for example) make a click of the button that draws a 1. Thus, the same thing that is done when clicking with the mouse on that button would be executed.

And another thing. Where can I find the list of commands and the syntax of all of them? I can't find it on the Wiki.

Thanks

FellippeHeitor

  • Guest
Re: Click event
« Reply #1 on: February 03, 2021, 06:34:01 am »
Hi, Juan.

To generate a click programmatically, you can call the __UI_Click SUB directly, passing the name of the control you wanna "click". For example:

Code: QB64: [Select]
  1. __UI_Click Button1

InForm's wiki is in need of an update indeed. In the meantime, feel free to ask here and I'll keep on providing assistance as you need it.

Offline Juanjogomez

  • Forum Regular
  • Posts: 117
    • View Profile
Re: Click event
« Reply #2 on: February 03, 2021, 08:16:12 am »
Thanks. I will try that