toggle with BTNBMP

Post Reply
User avatar
Otto
Posts: 4470
Joined: Fri Oct 07, 2005 7:07 pm
Contact:

toggle with BTNBMP

Post 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
 
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org

********************************************************************
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: toggle with BTNBMP

Post 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
 
Regards

G. N. Rao.
Hyderabad, India
User avatar
Otto
Posts: 4470
Joined: Fri Oct 07, 2005 7:07 pm
Contact:

Re: toggle with BTNBMP

Post by Otto »

Dear Mr. Rao,
thank you. This is working fine.
Best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org

********************************************************************
Post Reply