AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

Stringgrid spinnt

Ein Thema von Raucherbein · begonnen am 10. Mai 2005 · letzter Beitrag vom 10. Mai 2005
Antwort Antwort
Benutzerbild von Noinini
Noinini

Registriert seit: 12. Aug 2003
Ort: Kempen
38 Beiträge
 
Delphi 2007 Enterprise
 
#1

Re: Stringgrid spinnt

  Alt 10. Mai 2005, 12:00
Hi Matthias,

die Lösung von Jasocul ist schon richtig, Du musst nur statt der Schleife eine Abfrage machen, dass die Zeile richtig ist:
Delphi-Quellcode:
procedure TfrmMain.grdAnzeigeDrawCell(Sender: TObject; ACol, ARow: Integer;
  Rect: TRect; State: TGridDrawState);
var
  a : integer;
begin
  if (dayoftheweek(strtodate(grdAnzeige.Cells[acol, 0])) = 6) and not (gdFixed in State) then
  with grdAnzeige do
  begin
    Canvas.Brush.Color := $0000c3ff;
    Canvas.FillRect(Rect);
    Canvas.TextOut(Rect.Left+2, Rect.Top+2, Cells[ACol, ARow]);
  end; //färben des sonnabends

  if (dayoftheweek(strtodate(grdAnzeige.Cells[acol, 0])) = 7) and not (gdFixed in State) then
  with grdAnzeige do
  begin
    Canvas.Brush.Color := clred;
    Canvas.FillRect(Rect);
    Canvas.TextOut(Rect.Left+2, Rect.Top+2, Cells[ACol, ARow]);
  end; //färben des sonntages

// for a := 2 to grdAnzeige.RowCount do
// begin
    if aRow >= 2 then
    begin
      if grdAnzeige.Cells[acol,aRow] <> 'then //STATT "a" "aRow" eingesetzt
      with grdAnzeige do
      begin
        canvas.Brush.Color := clskyblue;
        canvas.FillRect(Rect);
        canvas.TextOut(rect.Left + 2, rect.Top + 2, cells[acol, arow]);
      end;
    end;

end;
Viele Grüße

Iris
Iris
  Mit Zitat antworten Zitat
Antwort Antwort


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 17:35 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz