How to change Bitmap on the fly for SBTN?

How to change Bitmap on the fly for SBTN?

Postby dutch » Tue Jun 19, 2007 5:56 pm

Dear All,

How to change BitMap (Resource) in TSBUTTON after Dialog ACTIVATE?

Example ( not work )
======
Code: Select all  Expand view
DEFINE DIALOG RESOURCE 'TEST'

REDEFINE SBUTTON oBtn PROMPT 'TEST' ID 11 OF oDlg ;
                ACTION ChangeBitMap( oBtn )

ACTIVATE DIALOG oDlg

Function ChangeBitMap( oBtn )
oBtn:hBitMap1 := LoadBitmap( GetResources(), 'SMILE' )
oBtn:Refresh()
return nil


Best Regards,
Dutch
User avatar
dutch
 
Posts: 1542
Joined: Fri Oct 07, 2005 5:56 pm
Location: Thailand

Postby Antonio Linares » Tue Jun 19, 2007 6:13 pm

Dutch,

Try it this way:

Code: Select all  Expand view
REDEFINE SBUTTON oBtn PROMPT 'TEST' ID 11 OF oDlg ;
                ACTION ( oBtn:LoadBitmaps( "smile" ), oBtn:Refresh() )
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby dutch » Wed Jun 20, 2007 3:33 am

Dear Antonio,

Thanks for your prompt reply. I've got it.

Code: Select all  Expand view
DEFINE DIALOG RESOURCE 'TEST'

REDEFINE SBUTTON oBtn PROMPT 'TEST' ID 11 OF oDlg ;
                ACTION ChangeBitMap( oBtn )

ACTIVATE DIALOG oDlg

Function ChangeBitMap( oBtn )
oBtn:LoadBitmaps( { 'SMILE' }, {} )   // ( aResource, aBmpFile )
oBtn:Refresh()
return nil


Best regards,
Dutch
User avatar
dutch
 
Posts: 1542
Joined: Fri Oct 07, 2005 5:56 pm
Location: Thailand


Return to FiveWin for CA-Clipper

Who is online

Users browsing this forum: No registered users and 9 guests