This sample shows the use of the customized tab preview in the Windows task bar for a Delphi/C++ application.
You can find the MDIApp sample project at:
- Start | Programs | Embarcadero RAD Studio Sydney | Samples and then navigate to either:
- Object Pascal\VCL\Taskbar\MDI
- Subversion Repository:
- You can find Delphi and C++ code samples in GitHub Repositories. Search by name into the samples repositories according to your RAD Studio version.
The application creates a main form that has the functionality to open images in a new child form. The application shows a thumbnail preview of each new image in the Windows task bar. You can close a tab by clicking the close button in the thumbnail preview in Windows task bar.
- Note: Only .bmp images can be opened.
How to Use the Sample
- Navigate to Start | Programs | Embarcadero RAD Studio Sydney | Samples and open:
- Delphi: MDIApp.dproj
- C++: CPPMDIApp.cbproj
- Press F9 or choose Run > Run.
This project has two source files:
The main form where new images are open and the child forms are created.
The child form where customized task bar preview functionality is done.
- TForm2, the form class, implements the main visual component of the application. It contains a TMainMenu component and a TActionList to open a image file in a child form.
- TFrMDIChild, the child form class, contains a TImage and the customized TTaskbar component. It implements the functionality to close the child form.
- For the main form, in the Object Inspector set the FormStyle property to
fsMDIForm. For the child form, in the Object Inspector set the FormStyle property to
- The menu item in the TMainMenu of the application is linked to the open file action in the TActionList, and a new child form is created for each opened image file.
- The TTaskbar component registers each new form as a new tab.
- For the TTaskbar component, in the Object Inspector set the CustomizedPreview property of the TabProperties to
True. A preview thumbnail of each image is shown in the application Windows task bar.