TcxCustomTabControl.OnGetImageIndex Event
Enables you to specify custom images for tabs.
Declaration
property OnGetImageIndex: TcxGetTabImageEvent read; write;
Remarks
Fires when the control layout is updated.
Sender specifies the page or tab control, which owns the handled tab.
TabIndex specifies the index of a tab whose icon is to be painted.
ImageIndex specifies the image index in the image collection (see the Images property).
The following example demonstrates how to specify the New tab button‘s custom icon (this image is the first item in the image collection – see the Images property):
//...
procedure <TForm1>.<cxPageControl1>GetImageIndex(Sender: TObject;
TabIndex: Integer; var ImageIndex: Integer);
begin
if TabIndex = cxPCNewButtonIndex then
ImageIndex := 0
else
ImageIndex := 1;
end;
end;
In the example, the cxPCNewButtonIndex constant is used to determine the New tab button‘s index.
See Also