1
General / Re: Colore celle StringGrid
« Last post by qk on Today at 09:34:32 pm »Se non hai dimistichezza con l'inglese aggiungi comunque una copia
del tuo messaggio tradotta anche con google translator.
In questo modo il messaggio sarà comprensibile a tutti e più persone potranno aiutarti.
Sotto un semplice esempio di come colorare le colonne dispari.
Google translator:
If you don't speak English well, still add a copy of your message
translated with Google translator. This way, the message will be
understandable to everyone, and more people can help you.
Below is a simple example of how to color the odd columns.
del tuo messaggio tradotta anche con google translator.
In questo modo il messaggio sarà comprensibile a tutti e più persone potranno aiutarti.
Sotto un semplice esempio di come colorare le colonne dispari.
Google translator:
If you don't speak English well, still add a copy of your message
translated with Google translator. This way, the message will be
understandable to everyone, and more people can help you.
Below is a simple example of how to color the odd columns.
- procedure TForm1.StringGrid1DrawCell(Sender: TObject; aCol, aRow: Integer;
- aRect: TRect; aState: TGridDrawState);
- begin
- if (ACol > 0) and (ARow > 0) then
- with Sender as TStringGrid do
- begin
- if Odd(ACol) then
- begin
- Canvas.Brush.Color := clGreen;
- Canvas.FillRect(aRect);
- Canvas.TextOut(aRect.Left + 2, ARect.Top + 2, Cells[ACol, ARow]);
- end else
- begin
- Canvas.Brush.Color := clRed;
- Canvas.FillRect(aRect);
- Canvas.TextOut(aRect.Left + 2, ARect.Top + 2, Cells[ACol, ARow]);
- end;
- end;
- end;