Visual Basic: Windows Controls

ClientHeight, ClientWidth, ClientLeft, ClientTop Properties

See Also    Example    Applies To

Return the coordinates of the internal area (display area) of the TabStrip control. Read-only at run time; not available at design time.

Syntax

object.ClientHeight

object.ClientWidth

object.ClientLeft

object.ClientTop

The object placeholder represents an object expression that evaluates to a TabStrip control.

Remarks

At run time, the client-coordinate properties ClientLeft, ClientTop, ClientHeight, and ClientWidth automatically store the coordinates of the TabStrip control's internal area, which is shared by all Tab objects in the control. So that the controls associated with a specific Tab appear when that Tab object is selected, place the Tab object's controls inside a container, such as a Frame control, whose size and position match the client-coordinate properties. To associate a container (and its controls) with a Tab object, create a control array, such as a Frame control array.

All client-coordinate properties use the scale mode of the parent form. To place a Frame control so it fits perfectly in the internal area, use the following code:

Frame1.Left = TabStrip1.ClientLeft
Frame1.Top = TabStrip1.ClientTop
Frame1.Width = TabStrip1.ClientWidth
Frame1.Height = TabStrip1.ClientHeight

To create the effect of placing a new tab and its associated container on top when the tab is selected:

  • Set the size and location of the container in the TabStrip control's internal area to the client-coordinate properties; and

  • Use the ZOrder method to place the selected tab's container control at the front or back of the z-order.