Is it possible to replace / change a Bitmap for a Button ( BTNBMP ) at runtime ?
Inside my Setup-section, I want to display a new selected Bitmap for a defined Button.
It works with REDEFINE BITMAP but using BTNBMP, the Button is not repainted.
- Code: Select all Expand view
// 1. Button
// --------------
REDEFINE BTNBMP oBtn81 ID 901 OF oDlg10 2007 ;
FILENAME c_path + "\system\Button.bmp" ;
PROMPT "Button 1" ;
FONT oFont1 ;
LEFT ;
ACTION ( cFilter := "BMP (*.bmp)|*.bmp|", ;
cNewBITM := cGetFile32( cFilter,"Select a Picture" ,, "\" + CurDir()+ "\project" ), ;
IIF( empty( cNewBITM ), MsgAlert( "No file selected !","ATTENTION" ), NIL ), ;
D_BUTTON1 := cFileNoPath( cNewBITM ), oButton1:Refresh(), ;
oBMP15:Refresh() )
oBtn81:cTooltip := "1. Button"
// That works, but it is not transparent.
// --------------------------------------------
REDEFINE BITMAP oBMP15 ID 411 ADJUST RESOURCE "Blanc" OF oDlg10 TRANSPARENT
oBMP15:bPainted := {|hDC| DRAW_IMG( oBMP15, D_BUTTON1) }
// With BTNBMP it doesn' work
// ---------------------------------
// REDEFINE BTNBMP oBMP15 ID 411 OF oDlg10 Adjust ;
// FILENAME c_path + "\project\" + D_BUTTON1
// oBMP15:lTransparent = .t.
Is there any solution for it ?
Regards
Uwe