OBJECT Form 99998 TestFormpje { OBJECT-PROPERTIES { Date=17-09-10; Time=10:03:18; Modified=Yes; Version List=; } PROPERTIES { Width=8030; Height=3740; LookupMode=Yes; OnOpenForm=BEGIN SomeCondition := CONFIRM('With the extra menuItem?'); CurrForm.LOOKUPMODE := SomeCondition; END; OnQueryCloseForm=BEGIN IF MenuBtnPushed THEN // Dont close the form. BEGIN MenuBtnPushed := FALSE; EXIT( FALSE); END; END; } CONTROLS { { 1000000000;MenuButton;5610;2860;2200;550 ;CaptionML=NLD=&Functies; Menu=MENUITEMS { { ID=1000000018; CaptionML=NLD=Switch visibility; OnPush=BEGIN SomeCondition := NOT SomeCondition; CurrForm.LOOKUPMODE := SomeCondition; END; } { ID=1000000019; PushAction=LookupOK; InvalidActionAppearance=Hide; CaptionML=NLD=Visible on Condition; OnPush=BEGIN MenuBtnPushed := TRUE; DoWhatYouWantToDoAtThisPlace; END; } } } { 1000000020;CommandButton;770;2860;2200;550;HorzGlue=Right; VertGlue=Bottom; Default=Yes; PushAction=LookupOK; InvalidActionAppearance=Hide } { 1000000021;CommandButton;3190;2860;2200;550; HorzGlue=Right; VertGlue=Bottom; Cancel=Yes; PushAction=LookupCancel; InvalidActionAppearance=Hide } } CODE { VAR MenuBtnPushed@1000000000 : Boolean; SomeCondition@1000000001 : Boolean; PROCEDURE DoWhatYouWantToDoAtThisPlace@1000000000(); BEGIN // BigFunction here... MESSAGE('Did something.'); END; BEGIN END. } }