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.

Assign Color value to oDBEdit/oDBEditMask Object

Xailer professional forum in English
Responder
david fung
Mensajes: 257
Registrado: Mié Jul 19, 2006 8:48 am

Assign Color value to oDBEdit/oDBEditMask Object

Mensaje por david fung »

How can I assign a nClrText value depend on the value of a database
field, with a DBNavigator on the form ie different records will be
displayed.
e.g. in DBFData5 sample, how could I change the colour of first name to
clRed if one is married ?
I lost this attribute (ability to change colour) when I focus on this
field ?! In what event(s) should I place
::oDBEdit1:nClrText := if( ::oDbfDataSet1:Married, clRed, clBlue) ??
Avatar de Usuario
ignacio
Site Admin
Mensajes: 9441
Registrado: Lun Abr 06, 2015 8:00 pm
Ubicación: Madrid, Spain
Contactar:

Assign Color value to oDBEdit/oDBEditMask Object

Mensaje por ignacio »

David,
Use the oDataSet:OnPostChange Event:
IF ::oDbEdit1 != NIL // necessary since the control oDBEdit1 is created
after the Dataset
::oDbEdit1:nClrPane := if( oSender:Married, clRed, clBlue)
::oDbEdit1:nClrPaneFocus := if( oSender:Married, clRed, clBlue)
ENDIF
Regards,
--
Ignacio Ortiz de Zúñiga
http://www.xailer.com
"david fung" <davfung@yahoo.com> escribió en el mensaje
news:[email=451a85dd@news.xailer.com...]451a85dd@news.xailer.com...[/email]
> How can I assign a nClrText value depend on the value of a database field,
> with a DBNavigator on the form ie different records will be displayed.
>
> e.g. in DBFData5 sample, how could I change the colour of first name to
> clRed if one is married ?
>
> I lost this attribute (ability to change colour) when I focus on this
> field ?! In what event(s) should I place
>
> ::oDBEdit1:nClrText := if( ::oDbfDataSet1:Married, clRed, clBlue) ??
Ignacio Ortiz de Zúñiga
[OZ Software]
https://www.ozs.es
--
[Equipo de Xailer / Xailer team]
https://www.xailer.com
NoName
Mensajes: 531
Registrado: Vie Feb 03, 2006 7:27 pm

Assign Color value to oDBEdit/oDBEditMask Object

Mensaje por NoName »

David,
Use the oDataSet:OnPostChange Event:
IF ::oDbEdit1 != NIL // necessary since the control oDBEdit1 is created
after the Dataset
::oDbEdit1:nClrPane := if( oSender:Married, clRed, clBlue)
::oDbEdit1:nClrPaneFocus := if( oSender:Married, clRed, clBlue)
ENDIF
Regards,
--
Ignacio Ortiz de Zúñiga
http://www.xailer.com
"david fung" <davfung@yahoo.com> escribió en el mensaje
news:[email=451a85dd@news.xailer.com...]451a85dd@news.xailer.com...[/email]
> How can I assign a nClrText value depend on the value of a database field,
> with a DBNavigator on the form ie different records will be displayed.
>
> e.g. in DBFData5 sample, how could I change the colour of first name to
> clRed if one is married ?
>
> I lost this attribute (ability to change colour) when I focus on this
> field ?! In what event(s) should I place
>
> ::oDBEdit1:nClrText := if( ::oDbfDataSet1:Married, clRed, clBlue) ??
david fung
Mensajes: 257
Registrado: Mié Jul 19, 2006 8:48 am

Assign Color value to oDBEdit/oDBEditMask Object

Mensaje por david fung »

Ignacio Ortiz de Zúñiga wrote:
> David,
>
> Use the oDataSet:OnPostChange Event:
>
> IF ::oDbEdit1 != NIL // necessary since the control oDBEdit1 is created
> after the Dataset
> ::oDbEdit1:nClrPane := if( oSender:Married, clRed, clBlue)
> ::oDbEdit1:nClrPaneFocus := if( oSender:Married, clRed, clBlue)
> ENDIF
>
> Regards,
Great, thank you Ignacio.
But it didn't work for the first record displayed. Anywhere else should
this code be placed ?
David
david fung
Mensajes: 257
Registrado: Mié Jul 19, 2006 8:48 am

Assign Color value to oDBEdit/oDBEditMask Object

Mensaje por david fung »

Ignacio Ortiz de Zúñiga wrote:
> David,
>
> Use the oDataSet:OnPostChange Event:
>
> IF ::oDbEdit1 != NIL // necessary since the control oDBEdit1 is created
> after the Dataset
> ::oDbEdit1:nClrPane := if( oSender:Married, clRed, clBlue)
> ::oDbEdit1:nClrPaneFocus := if( oSender:Married, clRed, clBlue)
> ENDIF
>
> Regards,
Great, thank you Ignacio.
But it didn't work for the first record displayed. Anywhere else should
this code be placed ?
David
david fung
Mensajes: 257
Registrado: Mié Jul 19, 2006 8:48 am

Assign Color value to oDBEdit/oDBEditMask Object

Mensaje por david fung »

david fung wrote:
> Ignacio Ortiz de Zúñiga wrote:
>> David,
>>
>> Use the oDataSet:OnPostChange Event:
>>
>> IF ::oDbEdit1 != NIL // necessary since the control oDBEdit1 is
>> created after the Dataset
>> ::oDbEdit1:nClrPane := if( oSender:Married, clRed, clBlue)
>> ::oDbEdit1:nClrPaneFocus := if( oSender:Married, clRed, clBlue)
>> ENDIF
>>
>> Regards,
>
Great, thank you Ignacio.
But it didn't work for the first record displayed. Anywhere else should
this code be placed ?
Any idea for the first record ?
david fung
Mensajes: 257
Registrado: Mié Jul 19, 2006 8:48 am

Assign Color value to oDBEdit/oDBEditMask Object

Mensaje por david fung »

david fung wrote:
> Ignacio Ortiz de Zúñiga wrote:
>> David,
>>
>> Use the oDataSet:OnPostChange Event:
>>
>> IF ::oDbEdit1 != NIL // necessary since the control oDBEdit1 is
>> created after the Dataset
>> ::oDbEdit1:nClrPane := if( oSender:Married, clRed, clBlue)
>> ::oDbEdit1:nClrPaneFocus := if( oSender:Married, clRed, clBlue)
>> ENDIF
>>
>> Regards,
>
Great, thank you Ignacio.
But it didn't work for the first record displayed. Anywhere else should
this code be placed ?
Any idea for the first record ?
Avatar de Usuario
ignacio
Site Admin
Mensajes: 9441
Registrado: Lun Abr 06, 2015 8:00 pm
Ubicación: Madrid, Spain
Contactar:

Assign Color value to oDBEdit/oDBEditMask Object

Mensaje por ignacio »

David,
Just call the same code on the OnInitialize form event.
Regards,
--
Ignacio Ortiz de Zúñiga
http://www.xailer.com
"david fung" <davfung@yahoo.com> escribió en el mensaje
news:[email=451b8e7f@news.xailer.com...]451b8e7f@news.xailer.com...[/email]
> david fung wrote:
>> Ignacio Ortiz de Zúñiga wrote:
>>> David,
>>>
>>> Use the oDataSet:OnPostChange Event:
>>>
>>> IF ::oDbEdit1 != NIL // necessary since the control oDBEdit1 is
>>> created after the Dataset
>>> ::oDbEdit1:nClrPane := if( oSender:Married, clRed, clBlue)
>>> ::oDbEdit1:nClrPaneFocus := if( oSender:Married, clRed, clBlue)
>>> ENDIF
>>>
>>> Regards,
>>
>
> Great, thank you Ignacio.
>
> But it didn't work for the first record displayed. Anywhere else should
> this code be placed ?
>
> Any idea for the first record ?
>
Ignacio Ortiz de Zúñiga
[OZ Software]
https://www.ozs.es
--
[Equipo de Xailer / Xailer team]
https://www.xailer.com
NoName
Mensajes: 531
Registrado: Vie Feb 03, 2006 7:27 pm

Assign Color value to oDBEdit/oDBEditMask Object

Mensaje por NoName »

David,
Just call the same code on the OnInitialize form event.
Regards,
--
Ignacio Ortiz de Zúñiga
http://www.xailer.com
"david fung" <davfung@yahoo.com> escribió en el mensaje
news:[email=451b8e7f@news.xailer.com...]451b8e7f@news.xailer.com...[/email]
> david fung wrote:
>> Ignacio Ortiz de Zúñiga wrote:
>>> David,
>>>
>>> Use the oDataSet:OnPostChange Event:
>>>
>>> IF ::oDbEdit1 != NIL // necessary since the control oDBEdit1 is
>>> created after the Dataset
>>> ::oDbEdit1:nClrPane := if( oSender:Married, clRed, clBlue)
>>> ::oDbEdit1:nClrPaneFocus := if( oSender:Married, clRed, clBlue)
>>> ENDIF
>>>
>>> Regards,
>>
>
> Great, thank you Ignacio.
>
> But it didn't work for the first record displayed. Anywhere else should
> this code be placed ?
>
> Any idea for the first record ?
>
david fung
Mensajes: 257
Registrado: Mié Jul 19, 2006 8:48 am

Assign Color value to oDBEdit/oDBEditMask Object

Mensaje por david fung »

Ignacio Ortiz de Zúñiga wrote:
> David,
>
> Just call the same code on the OnInitialize form event.
>
> Regards,
>
Thank you for your help, it could be a simple task, but still struggling
with all these OOP !
david fung
Mensajes: 257
Registrado: Mié Jul 19, 2006 8:48 am

Assign Color value to oDBEdit/oDBEditMask Object

Mensaje por david fung »

Ignacio Ortiz de Zúñiga wrote:
> David,
>
> Just call the same code on the OnInitialize form event.
>
> Regards,
>
Thank you for your help, it could be a simple task, but still struggling
with all these OOP !
Responder