Page 1 of 1

Retrieving Column clicked in LISTBOX browse

PostPosted: Tue Oct 11, 2005 8:14 am
by GWard
How can I access the column number clicked when using a LISTBOX?

I thought oLbx:nAtCol held the value but apparently it is always ZERO

PostPosted: Tue Oct 11, 2005 4:01 pm
by Antonio Linares
GWard,

You have to call it this way: oLbx:nAtCol( nColPixel ) where nColPixel is the column in pixels where the mouse has clicked.

You may review classes\wbrowse.prg to see how such method is used.

PostPosted: Wed Oct 12, 2005 8:22 am
by GWard
Many thanks,

I used oLbx:bLClicked := {|nRow,nCol,nKeyFlags| MyFunction(oLbx,nCol)}

Then

FUNCTION MyFunction(oLbx,nCol)
LOCAL iActualCol := oLbx:nAtCol(nCol)

do case
case iActualCol=1
endc
... Etc