Description


TabSheet is an individual page in a PageControl component.


Allows you to control the tabs of the PageControl component.




Class: TdbTabSheet


Properties

 Property

 Description

 BorderWidth: Integer

 Specifies the width of the control's border.

 Caption: string

 Defines the title of the tab.

 ControlCount: Integer

 Returns the number of child controls.

 Controls[i]: TControl

 Access to a control by its index.

 Cursor: TCursor

 Specifies the image used to represent the mouse pointer when it passes into the region covered by the control. More info.

 Enabled: Boolean

 Controls whether the component responds to mouse, keyboard, and timer events.

 Font: TFont

 Allows you to set font name, size, color and style. More info.

 Hint: string

 Hint contains the text string that appears when the user moves the mouse over the component, see also ShowHint

 Name: string

 The name of the component.

 PageIndex: Integer

 Indicates the index of the tab sheet in the list of tab sheets maintained by the page control.

 ShowHint: Boolean

 ShowHint specifies whether to show the Help Hint when the mouse pointer moves over the component, see also Hint

 TabIndex: Integer

 Indicates the position of the tab sheet in the set of visible tabs in a PageControl component. If a tab sheet's TabVisible property is false, the TabIndex property is -1.

 TabVisible: Boolean

 Specifies whether the tab of the TTabSheet object appears in its PageControl.

 Tag: Integer

 Allows you to assign a number to a component for your own needs.

 TagString: string

 Allows you to assign a string to a component for your own needs.

 Visible: Boolean

 Specifies whether the component appears onscreen.

 Left: Integer

 Specifies the horizontal coordinate of the left edge of a component relative to its parent.

 Top: Integer

 Specifies the vertical coordinate of the upper-left of a component relative to its parent.

 Width: Integer

 Specifies the horizontal size of the component in pixels.

 Height: Integer

 Specifies the vertical size of the component in pixels.

 




Methods

 Метод

 Описание

 function CanFocus: Boolean

 It checks if the component can get input focus, which is usually necessary before using the SetFocus method. If a component has TabVisible = False or Enabled = False then using the SetFocus method will cause an error.


Example: if Form1.PageControl1.Pages[0].CanFocus then Form1.PageControl1.Pages[0].SetFocus;

 function Focused: boolean

 Determines whether the control has input focus.

 procedure SetFocus

 Gives the input focus to the component.





События компонента

 Событие

 Описание

 OnEnter (Sender: TObject)

 Occurs when a control receives the input focus.

 OnExit (Sender: TObject)

 Occurs when the input focus shifts away from one control to another.

 OnMouseDown (Sender: TObject; MouseLeft, MouseRight, MouseMiddle: boolean; Shift, Alt, Ctrl: boolean; X, Y: Integer)

 Occurs when the user presses a mouse button with the mouse pointer over a control.

 OnMouseEnter (Sender: TObject)

 Occurs when the user moves the mouse into a control.

 OnMouseLeave (Sender: TObject)

 Occurs when the user moves the mouse outside of a control.

 OnMouseMove (Sender: TObject; Shift, Alt, Ctrl: boolean; X, Y: Integer)

 Occurs when the user moves the mouse pointer while the mouse pointer is over a control.

 OnMouseUp (Sender: TObject; MouseLeft, MouseRight, MouseMiddle: boolean; Shift, Alt, Ctrl: boolean; X, Y: Integer)

 Occurs when the user releases a mouse button that was pressed with the mouse pointer over a component.

 OnResize (Sender: TObject)

 Occurs immediately after the control is resized.

 OnDropFiles (Sender: TObject; ArrayOfFiles: array of string; X, Y: Integer)

 Occurs when user tries to drag and drop a file from explorer to a form. More info.





Example


// Change the title of the first tab
procedure Form1_Button1_OnClick (Sender: TObject; var Cancel: boolean);
begin
   Form1.PageControl1.Pages[0].Caption := 'Tab name';
end;