I think you are at REDEFINE this problem because using @ it seems that it works
No. It is because you are not doing it correctly.
Please try this program:
Code: Select all
#include "FiveWin.ch"
//----------------------------------------------------------------------------//
function Main()
local oDlg, aBtn[ 3 ]
local oFont1, oFont2
DEFINE FONT oFont1 NAME "TAHOMA" SIZE 0,-12
DEFINE DIALOG oDlg RESOURCE "Main" FONT oFont1
REDEFINE BTNBMP aBtn[ 1 ] PROMPT "Change" + CRLF + "Font" ID 110 OF oDlg CENTER
aBtn[ 1 ]:bAction := <||
DEFINE FONT oFont2 NAME "VERDANA" SIZE 0,-16 BOLD
AEval( aBtn, { |oBtn| oBtn:SetFont( oFont2 ), oBtn:Refresh() } )
RELEASE FONT oFont2
return nil
>
REDEFINE BTNBMP aBtn[ 2 ] PROMPT "Multi" + CRLF + "Line" ID 120 OF oDlg CENTER ;
ACTION AEval( aBtn, { |oBtn| oBtn:oFontBold := oFont1, oBtn:Refresh() } )
REDEFINE BTNBMP aBtn[ 3 ] PROMPT "Old" + CRLF + "Font" ID 130 OF oDlg CENTER ;
ACTION AEval( aBtn, { |oBtn| oBtn:oFontBold := nil, oBtn:SetFont( oFont1 ), oBtn:Refresh() } )
ACTIVATE DIALOG oDlg CENTERED
RELEASE FONT oFont1
return nil
rc file:
Code: Select all
#include "..\include\WinApi.ch"
main DIALOG 50, 67, 162, 76
STYLE DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "FiveWin Class TBtnBmp"
FONT 12, "MS Sans Serif"
{
CONTROL "", 110, "TBtnBmp", 0 | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 9, 41, 43, 21
CONTROL "", 120, "TBtnBmp", 0 | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 60, 41, 43, 21
CONTROL "", 130, "TBtnBmp", 0 | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 110, 41, 43, 21
}