Author Topic: Click event  (Read 87 times)

0 Members and 1 Guest are viewing this topic.

Offline Juanjogomez

  • Newbie
  • Posts: 94
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

Offline FellippeHeitor

  • QB64 Developer
  • Forum Resident
  • Posts: 2806
  • Let it go, this too shall pass.
    • QB64.org
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

  • Newbie
  • Posts: 94
Re: Click event
« Reply #2 on: February 03, 2021, 08:16:12 AM »
Thanks. I will try that