How to change Bitmap on the fly for SBTN?

Post Reply
User avatar
dutch
Posts: 1582
Joined: Fri Oct 07, 2005 5:56 pm
Location: Thailand
Been thanked: 3 times

How to change Bitmap on the fly for SBTN?

Post by dutch »

Dear All,

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

Example ( not work )
======

Code: Select all | Expand

DEFINE DIALOG RESOURCE 'TEST'REDEFINE SBUTTON oBtn PROMPT 'TEST' ID 11 OF oDlg ;                ACTION ChangeBitMap( oBtn ) ACTIVATE DIALOG oDlgFunction ChangeBitMap( oBtn )oBtn:hBitMap1 := LoadBitmap( GetResources(), 'SMILE' )oBtn:Refresh()return nil


Best Regards,
Dutch
User avatar
Antonio Linares
Site Admin
Posts: 42807
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Has thanked: 122 times
Been thanked: 116 times
Contact:

Post by Antonio Linares »

Dutch,

Try it this way:

Code: Select all | Expand

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

Antonio Linares
www.fivetechsoft.com
User avatar
dutch
Posts: 1582
Joined: Fri Oct 07, 2005 5:56 pm
Location: Thailand
Been thanked: 3 times

Post by dutch »

Dear Antonio,

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

Code: Select all | Expand

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