Página 1 de 1
Assign Color value to oDBEdit/oDBEditMask Object
Publicado: Mié Sep 27, 2006 4:08 pm
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) ??
Assign Color value to oDBEdit/oDBEditMask Object
Publicado: Mié Sep 27, 2006 4:57 pm
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) ??
Assign Color value to oDBEdit/oDBEditMask Object
Publicado: Mié Sep 27, 2006 4:57 pm
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) ??
Assign Color value to oDBEdit/oDBEditMask Object
Publicado: Jue Sep 28, 2006 1:12 am
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
Assign Color value to oDBEdit/oDBEditMask Object
Publicado: Jue Sep 28, 2006 1:12 am
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
Assign Color value to oDBEdit/oDBEditMask Object
Publicado: Jue Sep 28, 2006 10:57 am
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 ?
Assign Color value to oDBEdit/oDBEditMask Object
Publicado: Jue Sep 28, 2006 10:57 am
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 ?
Assign Color value to oDBEdit/oDBEditMask Object
Publicado: Jue Sep 28, 2006 11:59 am
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 ?
>
Assign Color value to oDBEdit/oDBEditMask Object
Publicado: Jue Sep 28, 2006 11:59 am
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 ?
>
Assign Color value to oDBEdit/oDBEditMask Object
Publicado: Vie Sep 29, 2006 1:19 am
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 !
Assign Color value to oDBEdit/oDBEditMask Object
Publicado: Vie Sep 29, 2006 1:19 am
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 !