hi again
i have a few pages with many TIWDatePicker.
in each one of them i need to check if the date is out-dated, in a 30 days range, or higher then 30 days.
it works fine in the OnClick event of the TIWDatePicker, but i can't make it work if the users just change the text of the date instead of clicking the dropdown month.
here is my OnClick procedure:
procedure TfrmAddVehicle.TIWDatePicker1Click(Sender: TObject; ADate: TDateTime);
begin
ChangeColorAfterChangeDateInDatePicker;
end;
and here is the procedure that check the dates :
i had to use the "For I:=0 To ComponentCount-1" because there are 30-40 DatePickers in a page, and i have 4 pages like that (governmental biurocratic page...) .
Procedure ChangeColorAfterChangeDateInDatePicker;
Var I : Integer;
Begin
For I:=0 To ComponentCount-1 Do
If (Components IS TTIWDatePicker) Then Begin
If (Components AS TTIWDatePicker).Date-Now>=30 Then (Components AS TTIWDatePicker).Font.Color:=clWebGreen
Else If (Components AS TTIWDatePicker).Date-Now<=0 Then (Components AS TTIWDatePicker).Font.Color:=clWebRed
Else (Components AS TTIWDatePicker).Font.Color:=clWebOrange;
End;//If (Components IS
End;
i tried to use this procedure in the OnAsyncChange, but nothing happened.
the color differences is my client's request
any idea how i can make it work?
thanks