ClientHeight, ClientLeft, ClientTop, ClientWidth Properties

Applies To

TabStrip control.

Description

Define the dimensions and location of the display area of a TabStrip.

Syntax

object.ClientHeight [ =Single]

object.ClientLeft [ =Single]

object.ClientTop [ =Single]

object.ClientWidth [ =Single]

The ClientHeight, ClientLeft, ClientTop, and ClientWidth property syntaxes have these parts:

Part

Description

object

Required. A valid object.

Single

Optional. For ClientHeight and ClientWidth, specifies the height or width, in points, of the display area. For ClientLeft and ClientTop, specifies the distance, in points, from the top or left edge of the TabStrip's container.


Remarks

At run time, ClientLeft, ClientTop, ClientHeight, and ClientWidth automatically store the coordinates and dimensions of the TabStrip's internal area, which is shared by objects in the TabStrip.

Example

The following example sets the dimensions of an Image to the size of a TabStrip's client area when the user clicks a CommandButton. This code sample uses the following properties: Height, Left, Top, Width, ClientHeight, ClientLeft, ClientTop, and ClientWidth.

To use this example, copy this sample code to the Declarations portion of a form. Make sure that the form contains:

  • A CommandButton named CommandButton1.
  • A TabStrip named TabStrip1.
  • An Image named Image1.
    Private Sub UserForm_Initialize()
        CommandButton1.Caption = "Size Image to Tab Area"
        CommandButton1.WordWrap = True
        CommandButton1.AutoSize = True
    End Sub
    
    Private Sub CommandButton1_Click()
        Image1.ZOrder (fmFront)             'Place Image in front of TabStrip
    
        'ClientLeft and ClientTop are measured from the edge of the TabStrip,
        'not from the edges of the form containing the TabStrip.
        Image1.Left = TabStrip1.Left + TabStrip1.ClientLeft
        Image1.Top = TabStrip1.Top + TabStrip1.ClientTop
        Image1.Width = TabStrip1.ClientWidth
        Image1.Height = TabStrip1.ClientHeight
    
    End Sub