HeaderPane
Main
Hide
Share Link
Print

MakeNaturalSize Method, SftTabs Object

Resizes the control (without client area) to its optimal height or width.

Syntax

VBobject.MakeNaturalSize

object

A SftTabs object.

Comments

The MakeNaturalSize method resizes a tab control without client area to its optimal height (or width for vertically aligned tabs).

If screen real-estate needs to be preserved, this method changes a horizontal tab control's height to its optimal height. A vertically aligned tab control is resized in width.

This method can only be used if the tab control doesn't have a client area (see ClientArea).

The Tabs.ForcedSize property can override the height/width of tab rows, affecting the tab control size.

The NaturalSize property can be used to determine the optimal size without resizing the control.

Example

Private Sub Form_Load()
    With SftTabs1
        .ClientArea = False
        .MakeNaturalSize
    End With
End Sub

Examples

VB6 View entire sample code

    With TabControl.Direct
        .BulkUpdate = True
        .Tabs.Clear
        For i = 1 To 9
            iTab = .Tabs.Add("Tab " & i)
            .Tab(iTab).ToolTip = "ToolTip For Tab " & i
        Next
        .Tabs.Current = 0
        .MakeNaturalSize
        .BulkUpdate = False
    End With
End Sub

Private Sub Form_Load()
    ' add sample tabs to the scrollable tab controls
    ' of course this could also be done at design time

See Also SftTabs Object | Object Hierarchy


Last Updated 11/19/2026 - (email)
© 2026 Softel vdm, Inc.