Page 1 of 1

oFont bug ?

Posted: Tue Dec 24, 2019 3:58 pm
by emeasoft
Hi Xailers,

Changing any oFont property of other objects using a TButtonClick event, changes it in TButton too.

Example:

Capturar.JPG
Capturar.JPG (33.3 KiB) Viewed 110 times


Doing like in the image changes TButton font to bold.

Regards,

André Corrêa

Re: oFont bug ?

Posted: Tue Dec 24, 2019 10:02 pm
by Hurricane
No bug.
See Tips: Font - Runtime Properties, the explanation and how to do.

emeasoft wrote:Changing any oFont property of other objects using a TButtonClick event, changes it in TButton too.
...
Doing like in the image changes TButton font to bold.

Regards,

André Corrêa

Re: oFont bug ?

Posted: Thu Dec 26, 2019 9:12 am
by ignacio
emeasoft wrote:Hi Xailers,

Changing any oFont property of other objects using a TButtonClick event, changes it in TButton too.

Example:

Capturar.JPG

Doing like in the image changes TButton font to bold.

Regards,

André Corrêa


Hi,

By default all the form controls share the same font object. Just do the following:

::oBtn1:oFont := TFont():Create( "Arial", 12, .T. )

Regards,

Re: oFont bug ?

Posted: Thu Dec 26, 2019 12:43 pm
by emeasoft
It works.

Thanks Ignacio!