How to return a button itself ?

Post Reply
ShumingWang
Posts: 454
Joined: Sun Oct 30, 2005 6:37 am
Location: Guangzhou(Canton),China

How to return a button itself ?

Post 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
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post 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
regards, saludos

Antonio Linares
www.fivetechsoft.com
ShumingWang
Posts: 454
Joined: Sun Oct 30, 2005 6:37 am
Location: Guangzhou(Canton),China

Post 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
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Shuming,

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

Very good :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
Post Reply