Menu Item - Default Property

Default makes a menu item the default option

Member of Menu Item (PRIM_MITM)

Data Type - Boolean

Details

The Default property makes the menu item the default option when used in a Menu Bar.
 
A double click on the parent menu item will cause the click event of the default menu item to be fired.

Example

In this example, double clicking Item1 will make MenuItem3 fire its click event.
Function Options(*DIRECT)
   Begin_Com Role(*EXTENDS #PRIM_FORM) Clientwidth(897) Clientheight(384) Componentversion(2) Top(227) Left(222) Menubar(#MenuBar1)
 
   Define_Com Class(#PRIM_MBAR) Name(#MenuBar1) Parent(#COM_OWNER)
   Define_Com Class(#PRIM_MITM) Name(#MenuItem1) Caption('Item1') Displayposition(1) Parent(#MenuBar1)
   Define_Com Class(#PRIM_SMNU) Name(#SubMenu1) Parent(#MenuItem1)
   Define_Com Class(#PRIM_MITM) Name(#MenuItem2) Displayposition(1) Parent(#SubMenu1) Caption('Item')
   Define_Com Class(#PRIM_MITM) Name(#MenuItem3) Displayposition(2) Parent(#SubMenu1) Caption('Default Item') Default(True)
   Define_Com Class(#PRIM_MITM) Name(#MenuItem4) Displayposition(3) Parent(#SubMenu1) Caption('Item')
   Define_Com Class(#PRIM_MITM) Name(#MenuItem5) Displayposition(4) Parent(#SubMenu1) Caption('Item')
 
   Evtroutine Handling(#MenuItem2.click #MenuItem3.click #MenuItem4.click #MenuItem5.click) Com_Sender(#Sender)
 
      #com_owner.Caption := #Sender.Name
 
   Endroutine
 
End_Com

See also

All Component Classes

Technical Reference

Febuary 18 V14SP2