Hi Gerard.
> I want to be able to highlight Mandatory and current field in focus,in some way, maybe using colours... but if a field is mandatory and has focus.. waht do i fo.. maybe use some other criteria.
>Also, How would I go about doing this.
>
The easiest way to do this is to add a property to your text box class. If you only want to deal with mandatory fields, you could make it a logical flag. But a more flexible way would be to add a 'cmode' property to your text box class that you could use in the instance to indicate mandatory, optional, read-only, etc. And you could display all of them in a different color all the time, not only when the text box has focus just bu putting some code in the text box class's refresh method like so:
WITH THIS
DO CASE
CASE .cMode = 'O'
.BackColor = RGB( 255, 255, 255 )
.ForeColor = RGB( 0,0,0 )
CASE .cMode = 'M'
.BackColor = RGB( 255,0,0 )
.ForeColor = RGB( 0,0,0 )
CASE .cMode = 'R'
.Enabled = .F.
OTHERWISE
.BackColor = RGB( 255, 255, 255 )
.ForeColor = RGB( 0,0,0 )
ENDCASE
ENDWITH
If you only want to flag mandatory fields and only want them a different color when they have focus, then put the code to do so in the text box's GotFocus method.
Marcia