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.

Change Font in TEdit Control

Foro público de Xailer en español
Responder
Mike Draper
Mensajes: 41
Registrado: Vie Jul 01, 2005 11:59 pm

Change Font in TEdit Control

Mensaje por Mike Draper »

I want to change change the font in an edit control to italics if I
determine that the user should not modify the data.
I have tried various techniques like:
oEdit1:oFont:lItalic := .t.
oEdit1:oFont::nStyle := 1
These tend to change other fonts, but not oEdit1.
I find that TFont():Create works but it seems overkill:
:oFont := NIL
:oFont := TFont():Create( "Arial", 9, 1, 400 )
I have attached a very small sample.
What am I doing wrong?
Mike Draper


Attached files ChangeFont.zip (1 KB)Â
Avatar de Usuario
ignacio
Site Admin
Mensajes: 9440
Registrado: Lun Abr 06, 2015 8:00 pm
Ubicación: Madrid, Spain
Contactar:

Change Font in TEdit Control

Mensaje por ignacio »

Mike,
The property lParentFont indicates that the control should use its parent
oFont object. Put this property to .F. before changing any of it.
Regards,
"Mike Draper" <draperm@cogeco.ca> escribió en el mensaje
news:42e4226a$[email=1@ozsrvnegro.ozlan.local...]1@ozsrvnegro.ozlan.local...[/email]
>I want to change change the font in an edit control to italics if I
>determine that the user should not modify the data.
>
> I have tried various techniques like:
>
> oEdit1:oFont:lItalic := .t.
> oEdit1:oFont::nStyle := 1
>
> These tend to change other fonts, but not oEdit1.
>
> I find that TFont():Create works but it seems overkill:
>
> :oFont := NIL
> :oFont := TFont():Create( "Arial", 9, 1, 400 )
>
> I have attached a very small sample.
>
> What am I doing wrong?
>
> Mike Draper
>
>
>
>
Ignacio Ortiz de Zúñiga
[OZ Software]
https://www.ozs.es
--
[Equipo de Xailer / Xailer team]
https://www.xailer.com
Mike Draper
Mensajes: 41
Registrado: Vie Jul 01, 2005 11:59 pm

Change Font in TEdit Control

Mensaje por Mike Draper »

Ignacio
That does not seem to make a difference. Try it in the TEST that I sent to
you.
"Ignacio Ortiz de Zúñiga" <InvalidAccount@ozs.com> wrote in message
news:42e49f07$[email=1@ozsrvnegro.ozlan.local...]1@ozsrvnegro.ozlan.local...[/email]
> Mike,
>
> The property lParentFont indicates that the control should use its parent
> oFont object. Put this property to .F. before changing any of it.
>
> Regards,
>
> "Mike Draper" <draperm@cogeco.ca> escribió en el mensaje
> news:42e4226a$[email=1@ozsrvnegro.ozlan.local...]1@ozsrvnegro.ozlan.local...[/email]
>>I want to change change the font in an edit control to italics if I
>>determine that the user should not modify the data.
>>
>> I have tried various techniques like:
>>
>> oEdit1:oFont:lItalic := .t.
>> oEdit1:oFont::nStyle := 1
>>
>> These tend to change other fonts, but not oEdit1.
>>
>> I find that TFont():Create works but it seems overkill:
>>
>> :oFont := NIL
>> :oFont := TFont():Create( "Arial", 9, 1, 400 )
>>
>> I have attached a very small sample.
>>
>> What am I doing wrong?
>>
>> Mike Draper
>>
>>
>>
>>
>
>
Avatar de Usuario
ignacio
Site Admin
Mensajes: 9440
Registrado: Lun Abr 06, 2015 8:00 pm
Ubicación: Madrid, Spain
Contactar:

Change Font in TEdit Control

Mensaje por ignacio »

Mike,
You should also assign the property oFont ON the tEdit objet. If you do not
assign that propery even if you have change lParentFont to false the control
will still use its parent Font.
Regards,
"Mike Draper" <draperm@cogeco.ca> escribió en el mensaje
news:42e4e1b6$[email=1@ozsrvnegro.ozlan.local...]1@ozsrvnegro.ozlan.local...[/email]
> Ignacio
>
> That does not seem to make a difference. Try it in the TEST that I sent
> to you.
>
> "Ignacio Ortiz de Zúñiga" <InvalidAccount@ozs.com> wrote in message
> news:42e49f07$[email=1@ozsrvnegro.ozlan.local...]1@ozsrvnegro.ozlan.local...[/email]
>> Mike,
>>
>> The property lParentFont indicates that the control should use its parent
>> oFont object. Put this property to .F. before changing any of it.
>>
>> Regards,
>>
>> "Mike Draper" <draperm@cogeco.ca> escribió en el mensaje
>> news:42e4226a$[email=1@ozsrvnegro.ozlan.local...]1@ozsrvnegro.ozlan.local...[/email]
>>>I want to change change the font in an edit control to italics if I
>>>determine that the user should not modify the data.
>>>
>>> I have tried various techniques like:
>>>
>>> oEdit1:oFont:lItalic := .t.
>>> oEdit1:oFont::nStyle := 1
>>>
>>> These tend to change other fonts, but not oEdit1.
>>>
>>> I find that TFont():Create works but it seems overkill:
>>>
>>> :oFont := NIL
>>> :oFont := TFont():Create( "Arial", 9, 1, 400 )
>>>
>>> I have attached a very small sample.
>>>
>>> What am I doing wrong?
>>>
>>> Mike Draper
>>>
>>>
>>>
>>>
>>
>>
>
>
Ignacio Ortiz de Zúñiga
[OZ Software]
https://www.ozs.es
--
[Equipo de Xailer / Xailer team]
https://www.xailer.com
Responder