Style Property, Label Control Example

The following example uses the Style property to specify the appearance of the tabs in MultiPage and TabStrip. This example also demonstrates using a Label. The user chooses a style by selecting an OptionButton.

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

Private Sub OptionButton1_Click()
    MultiPage1.Style = fmTabStyleTabs
    TabStrip1.Style = fmTabStyleTabs
End Sub

Private Sub OptionButton2_Click()
    'Note that the page borders are invisible
    MultiPage1.Style = fmTabStyleButtons
    TabStrip1.Style = fmTabStyleButtons
End Sub

Private Sub OptionButton3_Click()
    'Note that the page borders are invisible and
    'the page body begins where the tabs normally
     'appear.
    MultiPage1.Style = fmTabStyleNone
    TabStrip1.Style = fmTabStyleNone
End Sub

Private Sub UserForm_Initialize()
    Label1.Caption = "Page/Tab Style"
    OptionButton1.Caption = "Tabs"
    OptionButton1.Value = True
    MultiPage1.Style = fmTabStyleTabs
    TabStrip1.Style = fmTabStyleTabs
    
    OptionButton2.Caption = "Buttons"
    OptionButton3.Caption = "No Tabs or Buttons"
End Sub