SETFOCUS
Jump to navigation
Jump to search
Description
- This causes Windows to give input focus to this control. This means that, if some other control in the same window was highlighted and active, this control now becomes the highlighted and active control, receiving mouse and keyboard input.
Syntax
- controlType #handle.ext "setfocus"
- controlType #handle.ext "!setfocus"
Hints
- Controls with captions, or that can receive text input, have an exclamation point (!) preceding the "setfocus" command. The exclamation point distinguishes a command from the text or caption.
Example
nomainwin
statictext #1.st1 "This example shows the use of setfocus.", 10, 10, 200, 25
button #1.btn1 "Press Enter key", [quit], UL, 80, 150
open "Setfocus Demo" for window as #1
#1 "trapclose [quit]"
#1.btn1 "!setfocus"
wait
[quit]
close #1
end
Useful Procedures
' Place a useful function or sub using this keyword here