Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

TcxCustomTabControl.OnGetImageIndex Event

In This Article

Enables you to specify custom images for tabs.

#Declaration

Delphi
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):

Delphi
//...
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