AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Sprachen und Entwicklungsumgebungen Sonstige Fragen zu Delphi Delphi StringGrid Farbe einzelner Wörter in einzelnen Zellen defin.
Thema durchsuchen
Ansicht
Themen-Optionen

StringGrid Farbe einzelner Wörter in einzelnen Zellen defin.

Ein Thema von ZeroQool007 · begonnen am 5. Dez 2005 · letzter Beitrag vom 8. Dez 2005
 
ZeroQool007

Registriert seit: 30. Aug 2004
127 Beiträge
 
#11

Re: StringGrid Farbe einzelner Wörter in einzelnen Zellen de

  Alt 6. Dez 2005, 12:27
@ Lannes

Hmmm...ich habe irgendwie ein Problem bei einem Zeilenumbruch in der Zelle, er übernimmt immer nur die letzte Farbe für die erste Zeile u die Zeile bleibt Standardschwarz...

Delphi-Quellcode:
var
  s : String;
  x : Integer;
begin
  s := StringGrid_Test.Cells[ACol, ARow];
  StringGrid_Test.Canvas.FillRect(Rect);
  DrawText(StringGrid_Test.canvas.Handle, PChar(s), Length(s), Rect, DT_left+DT_Vcenter);
with StringGrid_Test do
    if not (gdFixed in State) then
    begin
      if Pos('Meier',Cells[ACol,ARow]) > 0 then
      begin
        s := Copy(Cells[ACol,ARow],1,Pos('!',Cells[ACol,ARow])-1);
        Canvas.Font.Style := [fsBold];
        Canvas.Font.Color := clred;
        Canvas.TextOut(Rect.Left+1,Rect.Top+2,s);

        x := Canvas.TextWidth(s);

        Canvas.Font.Style := [];
        Canvas.Font.Color := clBlue;
        s := Copy(Cells[ACol,ARow],Pos(' ',Cells[ACol,ARow]),MAXINT);
        Canvas.TextOut(Rect.Left+2+x,Rect.Top+2,s);
      end;

      if Pos('Müller',Cells[ACol,ARow]) > 0 then
      begin
        s := Copy(Cells[ACol,ARow],1,Pos('!',Cells[ACol,ARow])-1);
        Canvas.Font.Style := [fsBold];
        Canvas.Font.Color := clLime;
        Canvas.TextOut(Rect.Left+1,Rect.Top+2,s);

        x := Canvas.TextWidth(s);

        Canvas.Font.Style := [];
        Canvas.Font.Color := clBlue;
        s := Copy(Cells[ACol,ARow],Pos(' ',Cells[ACol,ARow]),MAXINT);
        Canvas.TextOut(Rect.Left+2+x,Rect.Top+2,s);
      end;
    end;
end;
  Mit Zitat antworten Zitat
 


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 01:22 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