In order for this site to work correctly we need to store a small file (called a cookie) on your computer. Most every site in the world does this, however since the 25th of May 2011, by law we have to get your permission first. Please abandon the forum if you disagree.

Para que este foro funcione correctamente es necesario guardar un pequeño fichero (llamado cookie) en su ordenador. La mayoría de los sitios de Internet lo hacen, no obstante desde el 25 de Marzo de 2011 y por ley, necesitamos de su permiso con antelación. Abandone este foro si no está conforme.

oFont bug ?

Xailer English public forum
User avatar
emeasoft
Posts: 1071
Joined: Wed Apr 01, 2009 4:12 pm
Location: emeasoft
Contact:

oFont bug ?

Postby emeasoft » Tue Dec 24, 2019 3:58 pm

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 109 times


Doing like in the image changes TButton font to bold.

Regards,

André Corrêa
User avatar
Hurricane
Posts: 116
Joined: Tue Mar 24, 2015 10:21 am
Location: Brasil
Contact:

Re: oFont bug ?

Postby Hurricane » Tue Dec 24, 2019 10:02 pm

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
Delphi [x]Harbour + GUI (all) | SQL FastReport
DevClub for Developers
User avatar
ignacio
Site Admin
Posts: 8608
Joined: Mon Apr 06, 2015 8:00 pm
Location: Madrid, Spain
Contact:

Re: oFont bug ?

Postby ignacio » Thu Dec 26, 2019 9:12 am

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,
Ignacio Ortiz de Zúñiga
[Equipo de Xailer / Xailer team]
http://www.xailer.com

Return to “English”