function NewTabControl( AParent: PControl; const Tabs: array of PKOLChar; Options: TTabControlOptions; ImgList: PImageList; ImgList1stIdx: Integer ): PControl;
Creates new tab control (like notebook).
function NewTabEmpty( AParent: PControl; Options: TTabControlOptions; ImgList: PImageList ): PControl;
Creates new empty tab control for using metods TC_Insert (to create Pages as Panel), or TC_InsertControl (if you want using your custom Pages).
To place child control on a certain page of TabControl, use property Pages[ Idx ], for example:
Label1 := NewLabel( TabControl1.Pages[ 0 ], 'Label1' );
To determine number of pages at run time, use property Count ;
to determine which page is currently selected (or to change selection), use property CurIndex ;
to feedback to switch between tabs assign your handler to OnSelChange event;
Note, that by default, tab control is created with a border lowered to tab control's parent. To remove it, you can apply WS_EX_TRANSPARENT extended style (see TControl.ExStyle property), but painting of some child controls can be strange a bit in this case (no border drawing for edit controls was found, but not always...). You can also apply style WS_THICKFRAME (TControl.Style property) to make the border raised.
Other methods and properties, suitable for tab control, are:
property OnChange: TOnEvent; |
|
---|---|
function IndexOf( const S: KOLString ): Integer; |
|
function SearchFor( const S: KOLString; StartAfter: Integer; Partial: Boolean ): Integer; |
|
function SetUnicode( Unicode: Boolean ): PControl; |
|
function TC_Insert( Idx: Integer; const TabText: KOLString; TabImgIdx: Integer ): PControl; |
|
procedure TC_Delete( Idx: Integer ); |
|
procedure TC_InsertControl( Idx: Integer; const TabText: KOLString; TabImgIdx: Integer; Page: PControl ); |
|
function TC_Remove( Idx: Integer ): PControl; |
|
procedure TC_SetPadding( cx, cy: Integer ); |
|
function TC_TabAtPos( x, y: Integer ): Integer; |
|
function TC_DisplayRect: TRect; |
|
function TC_IndexOf( const S: KOLString ): Integer; |
|
function TC_SearchFor( const S: KOLString; StartAfter: Integer; Partial: Boolean ): Integer; |
|
property ImageListNormal: PImageList; |
|
property Pages[ Idx: Integer ]: PControl; |
|
property TC_Pages[ Idx: Integer ]: PControl; |
|
property TC_Items[ Idx: Integer ]: KOLString; |
|
property TC_Images[ Idx: Integer ]: Integer; |
|
property TC_ItemRect[ Idx: Integer ]: TRect; |