Toolbar.Visible-Eigenschaft (Visio)
Bestimmt, ob ein Objekt sichtbar ist. Lese-/Schreibzugriff.
Syntax
Ausdruck. Sichtbar
Ausdruck Eine Variable, die ein Toolbar-Objekt darstellt.
Rückgabewert
Boolesch
Beispiel
Das folgende Beispiel zeigt, wie die Visible-Eigenschaft verwendet werden kann, um zu bestimmen, ob ein UIObject-Objekt in der Benutzeroberfläche sichtbar ist. 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 Visio-Symbolleisten wiederherzustellen.
Public Sub Visible_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
'Make the toolbar visible.
.Visible = True
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.
Feedback
https://aka.ms/ContentUserFeedback.
Bald verfügbar: Im Laufe des Jahres 2024 werden wir GitHub-Issues stufenweise als Feedbackmechanismus für Inhalte abbauen und durch ein neues Feedbacksystem ersetzen. Weitere Informationen finden Sie unterFeedback senden und anzeigen für