How to get the current active form in my application?

How to get the current active (focused) form in my application?

+6
source share
2 answers

You can program the following methods:

var CurrentForm: TForm; // Make sure to make it a global variable procedure KeyDownEvents(var Key: Word; Shift: TShiftState); begin CurrentForm:=Screen.ActiveForm.Name; if Key = VK_F9 then CurrentForm.KeyBoard1.Show; end; 

This will fix the problem. Similarly, you can process the form with a mouse click and another keystroke. Hope this helps.

+1
source

Screen.ActiveForm does the trick.

+10
source

Source: https://habr.com/ru/post/985874/


All Articles