Is it possible to change the gradient of BtnBmp at runtime ?
I tested to change the color on button-action, but doesn't work.
Maybe I have to destroy the button and rebuild ?
The button I want to change the gradient :
REDEFINE BTNBMP oBtn[10] OF oDlg2 UPDATE ;
ID 900 PIXEL 2007 ;
NOBORDER ;
PROMPT "&BUTTON-test" ;
ACTION oDlg2:End() ;
FONT oFont1 ;
LEFT
oBtn[10]:lTransparent := .t.
oBtn[10]:cToolTip = { "Gradient" + CRLF + "Test","Button-gradient", 1, CLR_BLACK, 14089979 }
oBtn[10]:SetColor( 0, )
oBtn[10]:bClrGrad = { | lMouseOver | If( ! lMouseOver,;
{ { 0.50, 12434811, 16777215 }, ;
{ 0.50, 16777215, 12434811 } }, ;
{ { 0.50, 255, 16777215 }, ;
{ 0.50, 16777215, 255 } } ) }
New colors of button 10 on action of button 3
REDEFINE BTNBMP oBtn[3] OF oDlg2 ;
ID 230 PIXEL 2007 ;
NOBORDER ;
PROMPT "&1. Color " ;
FILENAME c_path1 + "Paint.Bmp" ;
ACTION ( nBColorF1 := ChooseColor(), oBmp[4]:Refresh(), ;
oBtn[10]:EraseBkGnd( hDC ), ; // NO effect !
oBtn[10]:bClrGrad = { | lMouseOver | If( ! lMouseOver,;
{ { 0.50, nBColorF1, nBColorB1 }, ;
{ 0.50, nBColorB1, nBColorF1 } }, ;
{ { 0.50, nBColorF2, nBColorB2 }, ;
{ 0.50, nBColorB2, nBColorF2 } } ) }, ;
oBtn[10]:Refresh(), ) ; // NO effect !!!
FONT oFont1 ;
LEFT
oBtn[3]:lTransparent := .t.
oBtn[3]:cToolTip = { "1. Button-Gradient" + CRLF + "Color","Color-Selection", 1, CLR_BLACK, 14089979 }
oBtn[3]:SetColor( 0, )
best regards
Uwe
I tested to change the color on button-action, but doesn't work.
Maybe I have to destroy the button and rebuild ?
The button I want to change the gradient :
REDEFINE BTNBMP oBtn[10] OF oDlg2 UPDATE ;
ID 900 PIXEL 2007 ;
NOBORDER ;
PROMPT "&BUTTON-test" ;
ACTION oDlg2:End() ;
FONT oFont1 ;
LEFT
oBtn[10]:lTransparent := .t.
oBtn[10]:cToolTip = { "Gradient" + CRLF + "Test","Button-gradient", 1, CLR_BLACK, 14089979 }
oBtn[10]:SetColor( 0, )
oBtn[10]:bClrGrad = { | lMouseOver | If( ! lMouseOver,;
{ { 0.50, 12434811, 16777215 }, ;
{ 0.50, 16777215, 12434811 } }, ;
{ { 0.50, 255, 16777215 }, ;
{ 0.50, 16777215, 255 } } ) }
New colors of button 10 on action of button 3
REDEFINE BTNBMP oBtn[3] OF oDlg2 ;
ID 230 PIXEL 2007 ;
NOBORDER ;
PROMPT "&1. Color " ;
FILENAME c_path1 + "Paint.Bmp" ;
ACTION ( nBColorF1 := ChooseColor(), oBmp[4]:Refresh(), ;
oBtn[10]:EraseBkGnd( hDC ), ; // NO effect !
oBtn[10]:bClrGrad = { | lMouseOver | If( ! lMouseOver,;
{ { 0.50, nBColorF1, nBColorB1 }, ;
{ 0.50, nBColorB1, nBColorF1 } }, ;
{ { 0.50, nBColorF2, nBColorB2 }, ;
{ 0.50, nBColorB2, nBColorF2 } } ) }, ;
oBtn[10]:Refresh(), ) ; // NO effect !!!
FONT oFont1 ;
LEFT
oBtn[3]:lTransparent := .t.
oBtn[3]:cToolTip = { "1. Button-Gradient" + CRLF + "Color","Color-Selection", 1, CLR_BLACK, 14089979 }
oBtn[3]:SetColor( 0, )
best regards
Uwe
Since 1995 ( the first release of FW 1.9 )
i work with FW.
If you have any questions about special functions, maybe i can help.
i work with FW.
If you have any questions about special functions, maybe i can help.

