Vcl.Forms.TApplication.MainFormOnTaskBar

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

property MainFormOnTaskBar: Boolean read FMainFormOnTaskBar write SetMainFormOnTaskBar;

C++

__property bool MainFormOnTaskBar = {read=FMainFormOnTaskBar, write=SetMainFormOnTaskBar, nodefault};

Properties

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

Description

Controls how Windows taskbar buttons are handled in a VCL application.

If the MainFormOnTaskBar is True, a taskbar button represents the application's main form and displays its caption. If False, a taskbar button represents the application's (hidden) main window and bears the application's Title.

MainFormOnTaskBar must be True to use Windows Vista or Windows 7 Aero effects, including live taskbar thumbnails, Dynamic Windows, Windows Flip, and Windows Flip 3D.

If a change to the default behavior is required, MainFormOnTaskBar should be set in the project source file after Application.Initialize and before the main form creation. The MainFormOnTaskBar setting is intended to persist for the life of the application; later run-time changes of this property could result in unexpected behavior.

MainFormOnTaskBar defaults to True for applications created in Delphi 2007 and later products, and to False for earlier products.

The MainFormOnTaskBar property can be applied to older applications. Note that it affects the Z-order of your MainForm in case your application depends on this.

To update existing VCL applications, add the following line to the project source file (example includes the application initialization line, which must precede the line that sets MainFormOnTaskBar):

Delphi:

Application.Initialize;
...
Application.MainFormOnTaskbar := True;

C++:

Application->Initialize();
Application->MainFormOnTaskBar = true;

Note that the line is automatically added to new projects.

For further information, see http://www.microsoft.com/windows/products/windowsvista/features/experiences/aero.mspx.

See Also

Code Examples