Page 1 of 1

toggle with BTNBMP

Posted: Sun Jun 23, 2019 7:38 am
by Otto
Hello,
should toggle on BTNBMP work?
Best regards
Otto

Code: Select all

@ 10, 65;
   BTNBMP oBtnVerrechnung ;
          OF oDlg   FLAT ;
        SIZE 30, 30 ;
       PIXEL ;
      RESOURCE "CHECKON", "CHECKOFF" ;
        FONT oFont ;
      ACTION (  f_checkall(oBtnVerrechnung), oBtnVerrechnung:refresh() );
      COLOR  CLR_WHITE,  12088150
   
func f_checkall
...
if lToggle = .t.
    lToggle = .F.
    oBtnVerrechnung:bBmpNo := { || 2 }
else
    lToggle = .T.
    oBtnVerrechnung:bBmpNo := { || 1 }
endif
 

Re: toggle with BTNBMP

Posted: Sun Jun 23, 2019 11:36 am
by nageswaragunupudi

Code: Select all

function ToggleBtn()

   local oDlg, oBtn
   local lToggle  := .t.

   DEFINE DIALOG oDlg SIZE 400,400 PIXEL TRUEPIXEL

   @ 50,50 BTNBMP oBtn RESOURCE "c:\fwh\bitmaps\32X32\yes.bmp", nil, ;
                                "c:\fwh\bitmaps\32X32\no.bmp" ;
   ACTION ( lToggle := !lToggle )

   oBtn:bBmpNo    := { || If( lToggle, 1, 3 ) }

   ACTIVATE DIALOG oDlg CENTERED

return nil
 

Re: toggle with BTNBMP

Posted: Sun Jun 23, 2019 3:25 pm
by Otto
Dear Mr. Rao,
thank you. This is working fine.
Best regards,
Otto