FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Can change the caption of TButton "on the fly"?
Posts: 365
Joined: Sat Oct 08, 2005 07:59 PM
Can change the caption of TButton "on the fly"?
Posted: Mon Apr 02, 2007 09:35 PM
Can the caption of a Button be changed at runtime?. This example just does not do anything:
#include "Ficewin.ch"
Function Main()
Define Window ownd from 0,0 to 200,200 pixel
@ 10,10 Button oBtn Prompt "Hello" size 60,20 pixel of ownd action Change(oBtn)
Activate window oWnd
Return Nil

Function Change(oBtn)
oBtn:cCaption := "Bye"
oBtn:Refresh()
Return nil

Thanks
Rafael
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Can change the caption of TButton "on the fly"
Posted: Mon Apr 02, 2007 09:43 PM
#include "Fivewin.ch"


FUNCTION MAIN()

    LOCAL oDlg

    LOCAL oBtn

    DEFINE DIALOG oDlg

    @ 3, 1 BUTTON oBtn;
           PROMPT "&Original";
           ACTION oBtn:SetText( "Changed" )

    ACTIVATE DIALOG oDlg;
             CENTER

    RETURN NIL


EMG
Posts: 365
Joined: Sat Oct 08, 2005 07:59 PM
Can change the caption of TButton "on the fly"?
Posted: Tue Apr 03, 2007 07:24 AM

Enrico:
Thank you once more!!!
Rafael

Continue the discussion