Push Button - MenuPosition Property

Position of the menu when shown

Member of Push Button (PRIM_PHBN)

Data Type - Enumeration

Details

The MenuPosition property specifies where the menu will appear when shown.

If there is insufficient space, the menu will be moved automatically.

Allowed Values

Enum Value

Description

Bottom

Show below the button

Right

Show to the right of the button

Example

This example shows two buttons configured to use the same popup menu.

The MenuPosition and MenuSeparator properties have been used on the second button to change the where the menu appears and how the button manages a click and Enter.

     Function Options(*DIRECT)
Begin_Com Role(*EXTENDS #PRIM_FORM) Clientwidth(660) Clientheight(338) Componentversion(2) Top(215) Left(237)

Define_Com Class(#PRIM_PHBN) Name(#Button1) Caption('Button1') Displayposition(1) Left(7) Parent(#COM_OWNER) Tabposition(1) Top(6) Menu(#PopupMenu1) Width(90)
Define_Com Class(#PRIM_PHBN) Name(#Button2) Caption('Button2') Displayposition(2) Left(111) Parent(#COM_OWNER) Tabposition(2) Top(7) Width(138) Menu(#PopupMenu1) Menuposition(Right) Menuseparator(True)
Define_Com Class(#PRIM_PMNU) Name(#PopupMenu1)
Define_Com Class(#PRIM_MITM) Name(#MenuItem1) Caption('Item1') Displayposition(1) Parent(#PopupMenu1)
Define_Com Class(#PRIM_MITM) Name(#MenuItem2) Displayposition(2) Parent(#PopupMenu1) Caption('Item2') Default(True)
Define_Com Class(#PRIM_MITM) Name(#MenuItem3) Displayposition(3) Parent(#PopupMenu1) Caption('Item3')

Evtroutine Handling(#MenuItem1.Click #MenuItem2.Click #MenuItem3.Click) Com_Sender(#Sender)

#Com_owner.Caption := #Sender.Caption

Endroutine

End_Com

See also

All Component Classes

Technical Reference

  • No labels