Hinweis
Für den Zugriff auf diese Seite ist eine Autorisierung erforderlich. Sie können versuchen, sich anzumelden oder das Verzeichnis zu wechseln.
Für den Zugriff auf diese Seite ist eine Autorisierung erforderlich. Sie können versuchen, das Verzeichnis zu wechseln.
The following example uses the ScrollBars and the KeepScrollBarsVisible properties to add scroll bars to a page of a MultiPage and to a Frame. Der Benutzer wählt eine Optionsschaltfläche aus, die wiederum einen Wert für KeepScrollBarsVisible definiert.
To use this example, copy this sample code to the Script Editor of a form. To run the code you need to open the form so the Open event will activate. Make sure that the form contains:
Ein MultiPage -Objekt mit der Bezeichnung "MultiPage1".
Ein Rahmen-Steuerelement ( Frame ) mit der Bezeichnung "Frame1".
Vier Optionsfeld-Steuerelemente ( OptionButton ) mit der Bezeichnung "OptionButton1" bis "OptionButton4".
Sub Item_Open()
Set MultiPage1 = Item.GetInspector.ModifiedFormPages("P.2").Controls("MultiPage1")
Set Frame1 = Item.GetInspector.ModifiedFormPages("P.2").Controls("Frame1")
Set OptionButton1 = Item.GetInspector.ModifiedFormPages("P.2").Controls("OptionButton1")
Set OptionButton2 = Item.GetInspector.ModifiedFormPages("P.2").Controls("OptionButton2")
Set OptionButton3 = Item.GetInspector.ModifiedFormPages("P.2").Controls("OptionButton3")
Set OptionButton4 = Item.GetInspector.ModifiedFormPages("P.2").Controls("OptionButton4")
MultiPage1.Pages(0).ScrollBars = 3 '3=fmScrollBarsBoth
MultiPage1.Pages(0).KeepScrollBarsVisible = 0 '0=fmScrollBarsNone
Frame1.ScrollBars = 3 '3=fmScrollBarsBoth
Frame1.KeepScrollBarsVisible = 0 '0=fmScrollBarsNone
OptionButton1.Caption = "No scroll bars"
OptionButton1.Value = True
OptionButton2.Caption = "Horizontal scroll bars"
OptionButton3.Caption = "Vertical scroll bars"
OptionButton4.Caption = "Both scroll bars"
End Sub
Sub OptionButton1_Click()
Set MultiPage1 = Item.GetInspector.ModifiedFormPages("P.2").Controls("MultiPage1")
Set Frame1 = Item.GetInspector.ModifiedFormPages("P.2").Controls("Frame1")
MultiPage1.Pages(0).KeepScrollBarsVisible = 0 '0=fmScrollBarsNone
Frame1.KeepScrollBarsVisible = 0 '0=fmScrollBarsNonefmScrollBarsNone
End Sub
Sub OptionButton2_Click()
Set MultiPage1 = Item.GetInspector.ModifiedFormPages("P.2").Controls("MultiPage1")
Set Frame1 = Item.GetInspector.ModifiedFormPages("P.2").Controls("Frame1")
MultiPage1.Pages(0).KeepScrollBarsVisible = 1 '1=fmScrollBarsHorizontal
Frame1.KeepScrollBarsVisible = 1 '1=fmScrollBarsHorizontal
End Sub
Sub OptionButton3_Click()
Set MultiPage1 = Item.GetInspector.ModifiedFormPages("P.2").Controls("MultiPage1")
Set Frame1 = Item.GetInspector.ModifiedFormPages("P.2").Controls("Frame1")
MultiPage1.Pages(0).KeepScrollBarsVisible = 2 '2=fmScrollBarsVertical
Frame1.KeepScrollBarsVisible = 2 '2=fmScrollBarsVertical
End Sub
Sub OptionButton4_Click()
Set MultiPage1 = Item.GetInspector.ModifiedFormPages("P.2").Controls("MultiPage1")
Set Frame1 = Item.GetInspector.ModifiedFormPages("P.2").Controls("Frame1")
MultiPage1.Pages(0).KeepScrollBarsVisible = 3 '3=fmScrollBarsBoth
Frame1.KeepScrollBarsVisible = 3 '3=fmScrollBarsBoth
End Sub
Support und Feedback
Haben Sie Fragen oder Feedback zu Office VBA oder zu dieser Dokumentation? Unter Office VBA-Support und Feedback finden Sie Hilfestellung zu den Möglichkeiten, wie Sie Support erhalten und Feedback abgeben können.