StringGrid & DateTimePicker

0

Cześć wam , mam dwa pytanka:

  1. Czy w StringGrid jest tak możliwaść, aby zmienić kolory wybranych (programowo ) krotek na jakiś inny, chce aby krotki wyróżniały się między sobą. Jeśli się da, to w jaki sposób.

[browar]

  1. Pytanie drugie dotycz dni tygodnia :mam sobie datę w formacie rrrr-mm-dd i jak sprawdzić jaki jest to dzień tygodnia.

Za wszystkie rozsądne odpowiedzi bardzo dziękuję.
;P
[browar]

0

Ustaw sobie DefaultDrawing na false i przyjrzyj się zdarzeniu OnDrawCell oraz Canvasowi StringGrida :)

0

Berl, moge cię prosić o troszke więcej szczegółów. Dzięki.

0

Po ustawieniu DefaultDrawing na false dajesz tak w OnDrawCell :

if (aCol = 2) and (aRow=3) then begin //współrzędne komórki do pomalowania
    StringGrid1.Canvas.Brush.Color := clBlue; //kolor tła komórki
    StringGrid1.Canvas.FillRect(Rect);  // wypełniamy
    StringGrid1.Canvas.Font.Color := clWhite; //kolor czcionki
    StringGrid1.Canvas.TextOut( Rect.Left + 3, Rect.Top + 2, StringGrid1.Cells[aCol, aRow] ); // wyświetlenie tekstu
end;

</delphi>
0

Pytanie drugie dotycz dni tygodnia :mam sobie datę w formacie rrrr-mm-dd i jak sprawdzić jaki jest to dzień tygodnia.

<font color="brown"> Returns the day of the week represented by a TDateTime value.

Unit

DateUtils

Category

date/time routines

function DayOfTheWeek(const AValue: TDateTime): Word;

Description

Call DayOfTheWeek to obtain the day of the week represented by a specified TDateTime value. DayOfTheWeek returns a value between 1 and 7, where 1 indicates Monday and 7 indicates Sunday.

Note: DayOfTheWeek is ISO 8601 compliant (where Monday is considered the first day of the week). To obtain the day of the week where Sunday is considered the first day of the week, use the DayOfWeek function instead.
Tip: To make the return value more readable, use the Day of week constants.</span>

0

Berl i .. , dzieki za pomoc ; [browar]

1 użytkowników online, w tym zalogowanych: 0, gości: 1