Provides properties that let you manipulate menu items, such as:
Naming a menu item
Enabling a menu item.
Changing a menu item's background and foreground colors.
Enables or disables the specified menu item.
object.Enable[=Value As Boolean]
Boolean.
Read/write.
Value is an optional parameter that enables (TRUE) or disables (FALSE) the menu item.
See example in Example.
Sets or returns the background color of the menu item.
object.ItemBackColor[=ColorConstant As Constant]
Integer.
Read/write.
ColorConstant is an optional parameter that sets the background color of the menu item. See Section A.3, Background Color Constants.
See example in Example.
Sets or returns the foreground color of the menu item.
object.ItemForeColor[=ColorConstant As Constant]
Integer.
Read/write.
ColorConstant is an optional parameter that sets the foreground color of the menu item. See Section A.14, Foreground Color Constants.
See example in Example.
Returns the name of the menu item.
object.Name
String.
Read/write.
This example creates a text window with a menu using the properties and methods of the Menu object and MenuItem Object.
Win.Define(2,4,20,50)
Win.Title = "Sample Menu"
Win.Backcolor = 48
WIN.Visible=TRUE
WIn.TextWrap=TRUE
"Sets a menu object
Set menu = WIN.Menu
’Defines the position of the menuobject in the text window
menu.Define(2,4)
’sets the background color of the menu window
menu.Setbackcolor(80,112)
’Sets the foreground color of the menu window
menu.Setforecolor(6,2)
’Add a new menu item
menu.AddItem("New")
menu.Additem ("Open")
menu.Additem("Edit")
menu.Additem("Exit")
’Activates the menu window
item = menu.select()
’Returns the selected menu item
Set menuitem = menu.Getitem(item)
’Activates the menu item
menuitem.enable =TRUE
’Sets the background color of the menu item
menuitem.itembackcolor = 16
’Sets the foreground color of the menu item
menuitem.itemforecolor = 5
’displays the name of the menu item.
WIN.Popup("The selected menu item is ", menuitem.Name)