Dynamically create buttons
Posted: Tue Mar 10, 2015 6:59 pm
Friends Good afternoon.
I need to dynamically create buttons, each button has a color defined by state, when clicked the button will change its state and therefore change their color.
How do?
I need to dynamically create buttons, each button has a color defined by state, when clicked the button will change its state and therefore change their color.
How do?
Code: Select all
DO WHILE nSUITE <= 30
VERIFICASTATUS(SUITES->STATUS,nCORFONTE,nCORFUNDO,cNOMESTATUS)
@ nLIN, nCOL BTNBMP oBtn PROMPT cNOMESTATUS + CRLF + CRLF + SUITES->NUMERO + CRLF + ALLTRIM(SUITES->NOME) + CRLF + CRLF + "PAP 1010" + CRLF + CRLF + DTOC(DATE()) + CRLF + TIME() ;
SIZE 58, 83 TOP NOBORDER FONT wfonte_STATUS ACTION MSGINFO(TRATASUITE(xSUITE))
oBtn:SetColor(nCORFONTE , nCORFUNDO)
nSUITE ++
nCOL += 60
xSUITE ++
IF nCOL == 601
nLIN += 85
nCOL := 01
ENDIF
SUITES->(DBSKIP())
IF SUITES->(EOF())
EXIT
ENDIF
ENDDO