Can change the caption of TButton "on the fly"?

Post Reply
User avatar
Rafael Clemente
Posts: 365
Joined: Sat Oct 08, 2005 7:59 pm
Location: Barcelona, Spain

Can change the caption of TButton "on the fly"?

Post by Rafael Clemente »

Can the caption of a Button be changed at runtime?. This example just does not do anything:

Code: Select all

#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
User avatar
Enrico Maria Giordano
Posts: 7355
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia
Contact:

Re: Can change the caption of TButton "on the fly"

Post by Enrico Maria Giordano »

Code: Select all

#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
User avatar
Rafael Clemente
Posts: 365
Joined: Sat Oct 08, 2005 7:59 pm
Location: Barcelona, Spain

Post by Rafael Clemente »

Enrico:
Thank you once more!!!
Rafael
Post Reply