I have some buttons on a scrollpanel
I created the buttons with the Btnbmp class
I want that when I press one it stays selected
I made
lActive:= .f.
For n=1 to Len(aElements)
cDesc := aElements[n][2]
cImage := aElements[n][5]
nProduct:= aElements[n][1]
@ nRow,ncol BTNBMP aBtnEle[n] ;
FILENAME cImage;
SIZE 220, 55 PIXEL;
FLAT RIGHT;
FONT oFontSmall ;
PROMPT cDesc ;
OF oElements action Msginfo()
aBtnEle[n]:ocursor:= oHand
aBtnEle[n]:nClrBorder := { |obtn| (IIF(obtn:lMOver,CLR_BLUE,CLR_HGRAY)) }
aBtnEle[n]:bClrGrad = { | lInvert | If( ! lInvert,;
{ { 1, CLR_WHITE, CLR_WHITE } },;
{ { 1, RGB( 229,241,251 ), RGB( 229,241,251 ) } } ) }
aBtnEle[n]:cargo:= lActive
aBtnEle[n]:bAction :={ || lActive := !lActive, aBtnEle[n]:lpressed:=If( lActive, .t.,.f. ) }
nRow+=55
nCol:=10
NEXT
How I can resolve ?
I tried also with
aBtnEle[n]:cargo:= lActive
aBtnEle[n]:bAction :={ |o| lActive := !lActive, ;
o:cargo:= lActive,;
o:refresh(),;
nElemento:= val(nProduct) }