Page 1 of 1

Change the bitmap of GET ACTION

Posted: Wed Feb 05, 2020 8:48 pm
by betoncu
How can I change the bitmap of the GET with ACTION, when the user clicks on action button.
I have a login dialog and I want to show/Hide the password when the user clicks the button.

Code: Select all

 REDEFINE GET oPsw VAR cPsw ID 102 OF oDlg FONT oFont PASSWORD UPDATE ;
BITMAP "BTN_SHOWPSW" ;
ACTION ( oPsw:lPassword := !oPsw:lPassword, ;
         // Here I want to change it Something like IF( oPsw:lPassword, oPsw:cBitMap := "BTN_SHOWPSW", oPsw:cBitMap := "BTN_HIDEPSW")
         oDlg:UpDate() )

Re: Change the bitmap of GET ACTION

Posted: Thu Feb 06, 2020 11:03 am
by MaxP
Hi,

try this code

Code: Select all

REDEFINE GET oPsw VAR cPsw ID 102 OF oDlg FONT oFont PASSWORD UPDATE ;
    BITMAP "BTN_SHOWPSW" ;
    ACTION ( oPsw:lPassword := !oPsw:lPassword, ;
             oPsw :oBtn:LoadBitmap( IIF( oPsw:lPassword, "BTN_SHOWPSW", "BTN_HIDEPSW" ) ), ;
             oDlg:UpDate() )

Re: Change the bitmap of GET ACTION

Posted: Thu Feb 06, 2020 12:46 pm
by betoncu
Perfect. Thank you very much.