Vcl.Forms.TScreen.ActiveForm

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

property ActiveForm: TForm read FActiveForm;

C++

__property TForm* ActiveForm = {read=FActiveForm};

Properties

Type Visibility Source Unit Parent
property public
Vcl.Forms.pas
Vcl.Forms.hpp
Vcl.Forms TScreen

Description

Indicates which form currently has focus.

Read ActiveForm to learn which form in the application has input focus. If the application is not currently active, ActiveForm is the form that will have focus when the application becomes active again.

ActiveForm is a read-only property. To change the ActiveForm, use the SetFocus method of the form that should receive focus. ActiveForm also changes if the SetFocusedControl method of an inactive form is called to set focus to a control on that inactive form.

After focus shifts from one form to another, the screen receives an OnActiveFormChange event.

Note: If the application window with focus is not a TForm descendant (for example, if it is a property page), it will not appear as ActiveForm. To handle such cases, use the ActiveCustomForm property instead.

See Also

Code Examples