Toolbar.Top-Eigenschaft (Visio)
Ruft den Abstand zwischen dem oberen Rand eines Objekts und dem oberen Rand des Andockbereichs oder des oberen Bildschirms ab, wenn das Objekt nicht angedockt ist; Sie legt den Abstand zwischen dem oberen Rand eines Toolbar-Objekts und dem oberen Rand des Bildschirms fest. Lese-/Schreibzugriff.
Syntax
Ausdruck. Nach oben
Ausdruck Eine Variable, die ein Toolbar-Objekt darstellt.
Rückgabewert
Ganzzahl
Beispiel
Das folgende Beispiel zeigt, wie die Top-Eigenschaft verwendet werden kann, um die Position eines UIObject-Objekts festzulegen. In dem Beispiel wird eine benutzerdefinierte Symbolleiste zur Auflistung der geklonten Symbolleisten hinzugefügt. Diese Symbolleiste wird in der Microsoft Visio-Benutzeroberfläche angezeigt und ist verfügbar, während das Dokument aktiv ist.
Rufen Sie nach Ausführung dieses Makros die ThisDocument.ClearCustomToolbars-Methode auf, um die integrierten Symbolleisten in Visio wiederherzustellen.
Public Sub Top_Example()
Dim vsoUIObject As Visio.UIObject
Dim vsoToolbars As Visio.Toolbars
Dim vsoToolbar As Visio.Toolbar
'Check whether there are document custom toolbars.
If ThisDocument.CustomToolbars Is Nothing Then
'If not, check whether there are application custom toolbars.
If Visio.Application.CustomToolbars Is Nothing Then
'If not, use the built-in toolbars.
Set vsoUIObject = Visio.Application.BuiltInToolbars(0)
Else
'If there are application custom toolbars, clone them.
Set vsoUIObject = Visio.Application.CustomToolbars.Clone
End If
Else
'If there are custom toolbars in the document, use them.
Set vsoUIObject = ThisDocument.CustomToolbars
End If
'Get the Toolbars collection for the drawing window context.
Set vsoToolbars = vsoUIObject.ToolbarSets.ItemAtID( _
Visio.visUIObjSetDrawing).Toolbars
'Add a toolbar to the collection.
Set vsoToolbar = vsoToolbars.Add
With vsoToolbar
'Set the title of the toolbar.
.Caption = "My New Toolbar"
'Float the toolbar at coordinates (300,200).
.Position = Visio.visBarFloating
.Left = 300
.Top = 200
End With
'Use the custom toolbars in this document.
ThisDocument.SetCustomToolbars vsoUIObject
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.