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