DECLARE SUB mousedown(b, x, y, shift) DIM form AS QFORM form.onmousedown = mousedown form.SHOWMODAL SUB mousedown(b, x, y, shift) IF b = 0 THEN 'left butt clicked SHOWMESSAGE "left button clicked" END IF IF b = 1 THEN 'right butt clicked SHOWMESSAGE "right button clicked" END IF END SUB