02-15-2024, 11:32 PM
Quote:If I click on "Calculate" (Berechnen) under VB, then I can program it, but how does it work in InForm?Well, unlike VB, QB64 does not have user created callbacks / event handlers.
Hence, you will find that the ".bas" that InForm generates will have a bunch of subroutines with "SELECT CASE". Use these functions to handle the UI events.
For example, __UI_Click() handles all control click events. Also note that all controls have a unique ID and hence the usage of LONG.
Code: (Select All)
SUB __UI_Click (id AS LONG)
SHARED Game AS GameType
SELECT CASE id
CASE GameMenuExit
OnExit
CASE HelpMenuAboutFourUp
MessageBox "Four Up: Classic Connect 4 game\n\nCopyright (c) 2024 Samuel Gomes\n\nhttps://github.com/a740g/", Caption(FourUp) + " - About", MsgBox_Information
CASE GameMenuUndo
IF NOT GameBusy AND GameGetPlayer = GAME_BOARD_PLAYER_O AND GameGetMoves > 1 THEN
GameBusy = TRUE
GameUndoMove ' undo AI move
GameUndoMove ' undo player move
GameBusy = FALSE
END IF
See the InForm-PE wiki for more details: https://github.com/a740g/InForm-PE/wiki