FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Question: How do I change a button's label
Posts: 464
Joined: Tue May 16, 2006 07:47 AM
Question: How do I change a button's label
Posted: Wed Jul 11, 2007 10:50 PM

oMyButton:cCaption := "New label" executes without error but the display is not affected. What else do I need to do?

Thanks

xProgrammer

Posts: 253
Joined: Fri Feb 03, 2006 04:21 PM
Question: How do I change a button's label
Posted: Wed Jul 11, 2007 10:51 PM

:REFRESH()

Ari

Thanks,
Ari

FWH 2501 - Harbour 3.2.0 - Embarcadero 7.43 - MySQL
São Paulo - SP - Brasil
www.sisrev.com.br
Posts: 464
Joined: Tue May 16, 2006 07:47 AM
Thanks - and the solution
Posted: Thu Jul 12, 2007 12:16 AM

Thanks for the suggestion Ari - but the problem was deeper. Although cCaption contains the text that appears on the button, changing cCaption doesn't filter up to the parent classes - it just changes the value in the button object. After a fair bit of searching source code and experimentation I found that oMyButton:SetText("New Caption") works - which in hindsight is logical but I didn't see it because it is inherited back from the Window class and I was just looking at button class and control class.

xProgrammer

Continue the discussion