Page 1 of 1

How to return a button itself ?

Posted: Tue Jun 03, 2008 3:52 am
by ShumingWang
Hi,
Redefine button obutton id 201 of odlg action fun1(obutton)
This shows run time error : var obutton does not exists
I want
function fun1(obutton)
array1:=arect(obutton)
ACTIVATE MENU omenubill OF odlg at array1[1], array1[2]
// build a menu at obutton nrow,ncol
return

Regards !
Shuming Wang

Posted: Tue Jun 03, 2008 7:37 am
by Antonio Linares
Shuming,

Have you previously declared a:

local oButton

Also, replace these lines:

oRect := obutton:GetRect()
ACTIVATE MENU omenubill OF odlg at oRect:nTop, oRect:nLeft

Posted: Tue Jun 03, 2008 8:12 am
by ShumingWang
Antonio,
1.Yes, I missed done local obutton.

2.oRect := obutton:GetRect()
ACTIVATE MENU omenubill OF odlg at oRect:nTop, oRect:nLeft

This always show menu at right area of nomodal dialog

3. array1:= GetCoors(obutton:hwnd)
ACTIVATE MENU omenubill OF odlg at array1[1], array1[2]

This shows menu at button proper position on nomodal dialog .

Thank you !
Shuming Wang

Posted: Tue Jun 03, 2008 8:15 am
by Antonio Linares
Shuming,

Right. Thats another way of doing it without using a TRect object.

Very good :-)