Autor Beitrag
dragonlord
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 40

Win XP - SP2
D7 Ent.
BeitragVerfasst: Fr 08.04.05 15:58 
Hallo,

gibt es irgend eine Möglichkeit die Auswahlfarbe eines DBFrids zu ändern?
Normalerweise ist der Auswahlbalken ja in diesem "Blau". Leider gibt es keine Eigenschaft
wo man das ändern kann. Gibt es eine andere Lösung?
UGrohne
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Veteran
Beiträge: 5502
Erhaltene Danke: 220

Windows 8 , Server 2012
D7 Pro, VS.NET 2012 (C#)
BeitragVerfasst: Fr 08.04.05 16:32 
Suche in: Delphi-Forum, Delphi-Library DBGRID FARBE Das dürfte eigentlich reichen ;-)
dragonlord Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 40

Win XP - SP2
D7 Ent.
BeitragVerfasst: Mo 11.04.05 09:07 
Nein das reicht leider nicht :D

Da ich die Suchfunktion kenne habe ich diese natürlich auch vorher benutzt.
In den Ergebnissen findet sich leider kener Information darüber.

Gruss
Dragonlord
jasocul
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 6393
Erhaltene Danke: 147

Windows 7 + Windows 10
Sydney Prof + CE
BeitragVerfasst: Mo 11.04.05 11:02 
Dann gibt es wohl nur die Möglichkeit das Ereignis OnDrawDataCell zu überarbeiten.
Wenn du dort den Status (state) gdSelected abfragst, müsstest du an der richtigen Stelle sein.
dragonlord Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 40

Win XP - SP2
D7 Ent.
BeitragVerfasst: Mo 11.04.05 13:24 
Und wie mache ich das?
dragonlord Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 40

Win XP - SP2
D7 Ent.
BeitragVerfasst: Mo 11.04.05 13:30 
OK. Habe es soweit:
ausblenden Delphi-Quelltext
1:
2:
3:
f gdSelected in State then begin
      DBGrid1.Canvas.Brush.Color := clLime;
      DBGrid1.Canvas.FillRect(Rect);


Das Problem ist aber das man den text dann nicht mehr sieht

:?: :?:
dragonlord Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 40

Win XP - SP2
D7 Ent.
BeitragVerfasst: Mo 11.04.05 13:40 
OK. Habs:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
if gdSelected in State then
  begin
      DBGrid1.Canvas.Brush.Color := clSilver;
      DBGrid1.Canvas.FillRect(Rect);
      //DBGrid1.DefaultDrawDataCell(Rect, DataCol, Column, State);
      DBGrid1.DefaultDrawDataCell(Rect, Field, State);
  end;