CreateExpander(Row: Integer; Column: Integer; Length; Integer; ExpanderKind: TabExpanderKind);
Row. Index of the row that contains the cell with expander. Allowed parameter value is in the range [0;ITabSheet.RowsCount).
Column. Index of the column that contains the cell with expander. Admissible parameter value lies within the range [0; ITabSheet.ColumnsCount).
Length. Number of the rows or columns affected by expander. The parameter can also be negative.
ExpanderKind. Type of hierarchy icon.
The CreateExpander method allows to create an expander in the cell, the coordinates of which are passed as the Row and Column input parameters.
If the Length parameter is positive, the expander opens down and to the right, if the parameter is negative, the expander opens up and to the left.
To change expander icon, use the ITabSheet.ExpanderOnPicture and ITabSheet.ExpanderOffPicture properties.
Executing the example requires that the repository contains a regular report with the REP_TABSHEET identifier. The file system should contain two images: C:/On.gif and C:/Off.gif.
Add links to the Drawing, Metabase, Report, Tab system assemblies.
Sub UserProc;
Var
MB: IMetabase;
Rep: IPrxReport;
SheetT: IPrxTable;
Tab: ITabSheet;
TImg: ITabImages;
ExpOn, ExpOff: Integer;
Begin
MB := MetabaseClass.Active;
Rep := MB.ItemById("REP_TABSHEET").Edit As IPrxReport;
SheetT := Rep.Sheets.Item(0) As IPrxTable;
Tab := SheetT.TabSheet;
Tab.CreateExpander(0, 0, 4, TabExpanderKind.Rows);
TImg := Tab.Images;
ExpOn := TImg.Add(GxImage.FromFile("C:/On.gif"));
ExpOff := TImg.Add(GxImage.FromFile("C:/Off.gif"));
Tab.ExpanderOnPicture := ExpOn;
Tab.ExpanderOffPicture := ExpOff;
(Rep As IMetabaseObject).Save;
End Sub UserProc;
After executing the example new icons corresponding to the images C:/On.gif and C:/Off.gif respectively are assigned as the folded and unfolded expander icons.
See also: