Página 1 de 1

Change Font in TEdit Control

Publicado: Lun Jul 25, 2005 1:21 am
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)Â

Change Font in TEdit Control

Publicado: Lun Jul 25, 2005 10:12 am
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
>
>
>
>

Change Font in TEdit Control

Publicado: Lun Jul 25, 2005 2:57 pm
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
>>
>>
>>
>>
>
>

Change Font in TEdit Control

Publicado: Mar Jul 26, 2005 11:15 am
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
>>>
>>>
>>>
>>>
>>
>>
>
>