ZenMenu

 

Remarks Properties Methods DynProperties Samples

ED
avaliable
RT
read only

Remarks:Top

With an object of this type a context or main menu item can be edited, deleted, created,...

Properties:Top

BackColor Count ID
IsPulldown Name Notes
Parent TextColor  

Methods:Top

Create Delete DynPropertiesEnum[GET]
DynProperties[GET] DynProperties[PUT] Item

DynProperties:Top

Name Type Description
BackColor ZT_COLOR

Background color

Background color for the selected menu.

Read more in the online manual

Font ZT_SCHRIFT

Font

Font of the menus.

Read more in the online manual

Name String

Name

Unique name of the menu.
Default: New main menu x or New context menu x (where x is a consecutive number).

ATTENTION: This property is not available for language switching.

Read more in the online manual

Notes String With this property you have the opportunity to get/set notes from a menu.
Pulldown Boolean With this property you have the opportunity to select wheter the menu is a main or a context menu.
TRUE = It's a main menu, FALSE = It's a context menu.
TextColor ZT_COLOR

Text color

Text color for the selected menu.

Read more in the online manual

Samples:Top

'This sample creates a main menu with 5 items and sets the backcolor of the menu.
Sub ZenMenu()

Dim zMenus As ZenMenus  'Parent object
Dim zMenu As ZenMenu	'Child object of ZenMenus
Dim zMenuItem As ZenMenuItem 'Child object of ZenMenu
Dim i As Integer	'Loop variable

Set zMenus = MyWorkspace.ActiveDocument.ZenMenus

'Create a main menu
Set zMenu = zMenus.Create("Main_1")
'Is true for main menu and false for context menu
zMenu.IsPulldown = True

'Create 5 main menu items
For i = 0 To 4
Set zMenuItem = zMenu.Create("ID_" & i, False)
'Set the text of the main menu item
zMenuItem.Caption = "Item_" & i
Next i

'Set Background color of the main menu
zMenu.BackColor = 12345678

'Check how many items are available in this main menu
Debug.Print "Count = " & zMenu.Count

End Sub