PushedPicture: Integer;
The PushedPicture property determines the index of the image to be displayed in a table cell when a user clicks on it.
Collection of the table images is available in the Images property. To use images in a cell, the EnablePictures property should be set to the TriState.OnOption value. The image set in this property is not displayed unless the NormalPicture image is set.
To execute the example a form with a button named Button1 on it, a TabSheetBox component, a UiTabSheet component named UiTabSheet, and an ImageList component named ImageList1 are required. The UiTabSheet1 is a data source for the TabSheetBox component. The ImageList1 component contains a certain set of images.
Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
TSheet: ITabSheet;
TRange: ITabRange;
Style: ITabCellStyle;
Begin
TSheet := UiTabSheet1.TabSheet;
TSheet.Images.AddFromImageList(ImageList1);
TRange := TSheet.View.Selection.Range;
Style := TRange.Style;
Style.EnablePictures := TriState.OnOption;
Range.Style.NormalPicture := 1;
Range.Style.PushedPicture := 2;
End Sub Main;
On clicking the button images of the ImageList1 component are added to the image collection of the table. The image with the index 1 is displayed for the selected cells' range in normal mode. Click any image to display the image with the index 2.
See also: