Skip to content

ActivateGadget

Narta Xaymar Dirks edited this page Oct 28, 2026 · 5 revisions
BlitzPlus

ActivateGadget

ActivateGadget:Void gadget:Int32
Parameter Mode Type Default Description
gadget In Int32 required Handle of the gadget that should get the focus.

Description

Gives the keyboard focus to a gadget, so that typing goes to it. Use it to put the cursor in a text field when a window opens. Giving the focus to the window itself makes keys like Escape reach the window again.

Examples

Graphics 320, 240, 32, 2
win = CreateWindow("Focus", 10, 10, 300, 120, Desktop(), 3)
CreateLabel "Name:", 10, 10, 120, 24, win
name = CreateTextField(10, 36, 200, 24, win)
ActivateGadget name
Repeat
Until WaitEvent() = $803

Media

ActivateGadget

Related Commands

AddGadgetItem, ClearGadgetItems, CountGadgetItems, DisableGadget, EnableGadget, FreeGadget, HideGadget, ShowGadget

Home · Command Index



Differences
Language Features
BlitzBasic
Blitz3D
BlitzPlus

Clone this wiki locally