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

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

Postby Rafael Clemente » Mon Apr 02, 2007 9:35 pm

Can the caption of a Button be changed at runtime?. This example just does not do anything:
Code: Select all  Expand view  RUN
#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
Rafael Clemente
 
Posts: 365
Joined: Sat Oct 08, 2005 7:59 pm
Location: Barcelona, Spain

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

Postby Enrico Maria Giordano » Mon Apr 02, 2007 9:43 pm

Code: Select all  Expand view  RUN
#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
Enrico Maria Giordano
 
Posts: 8718
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby Rafael Clemente » Tue Apr 03, 2007 7:24 am

Enrico:
Thank you once more!!!
Rafael
User avatar
Rafael Clemente
 
Posts: 365
Joined: Sat Oct 08, 2005 7:59 pm
Location: Barcelona, Spain


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 27 guests