Autor Beitrag
Bondfreak
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 21

Win XP Prof, Kubuntu Dapper Drake
Delphi 6 (besitze auch 2005 und 2006)
BeitragVerfasst: Do 22.03.07 21:36 
Ich habe ein StringGrid, in dem von Beginn an etwas steht. Je nachdem was in der jeweiligen Zelle steht, wird seine Hintergrundfarbe mit OnDrawCell verändert.
Wie kann ich nun, nachdem ich noch mehr selbst ins Grid enigegeben hab, OnDrawCell für das gesamte Grid erneut aufrufen, ohne das ich dazu schleifen benutze, die einmal von 0 bis maxspaltenanzahl und zum anderen vno 0 bis maxzeilenahzahl laufen?
Hobby-Programmierer
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 238
Erhaltene Danke: 4

Win XP Pro, Vista Ultimate Trial :o)
D6 Pro, D7 Pro, Turbo, XE SE
BeitragVerfasst: Do 22.03.07 22:02 
Nabend ...,
wenn sich ein Wert in der Celle ändert wird DrawCell automatisch aufgerufen. Du könntest aber auch Repaint, Update oder ähnliches nutzen. Einfach mal die Methoden von TStringGrid in der Hilfe nachschlagen.

LG Mario
Bondfreak Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 21

Win XP Prof, Kubuntu Dapper Drake
Delphi 6 (besitze auch 2005 und 2006)
BeitragVerfasst: Do 22.03.07 22:25 
auf die idee bin ich auch schon gekommen, jedoch tut sich im programm nichts. mittlerweile denke ich aber, dass es an der farbenübergabe liegt, die je nach wort ja anders ist.
Lannes
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2352
Erhaltene Danke: 4

Win XP, 95, 3.11, IE6
D3 Prof, D4 Standard, D2005 PE, TurboDelphi, Lazarus, D2010
BeitragVerfasst: Do 22.03.07 22:32 
Hallo,

hast Du die Ereignisbehandlungs-Prozedur DrawCell auch dem StringGrid zugewiesen?

_________________
MfG Lannes
(Nichts ist nicht Nichts) and ('' <> nil ) and (Pointer('') = nil ) and (@('') <> nil )
Bondfreak Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 21

Win XP Prof, Kubuntu Dapper Drake
Delphi 6 (besitze auch 2005 und 2006)
BeitragVerfasst: Do 22.03.07 22:36 
user profile iconLannes hat folgendes geschrieben:
Hallo,

hast Du die Ereignisbehandlungs-Prozedur DrawCell auch dem StringGrid zugewiesen?


ich hab ja schon im eingangspost geschrieben, dass sich die zellen verändern, wenn etwas drinsteht, also muss sie logischerweise zugewiesen sein ;)
Lannes
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2352
Erhaltene Danke: 4

Win XP, 95, 3.11, IE6
D3 Prof, D4 Standard, D2005 PE, TurboDelphi, Lazarus, D2010
BeitragVerfasst: Do 22.03.07 22:59 
Hallo,

muss ich wohl übersehen haben :angel:, hab mich dadurch zu der Frage verleiten lassen:
user profile iconHobby-Programmierer hat folgendes geschrieben:
Nabend ...,
wenn sich ein Wert in der Celle ändert wird DrawCell automatisch aufgerufen. ...
und dann
user profile iconBondfreak hat folgendes geschrieben:
auf die idee bin ich auch schon gekommen, jedoch tut sich im programm nichts.


Aber nun zurück zum Problem :wink:
user profile iconBondfreak hat folgendes geschrieben:
...mittlerweile denke ich aber, dass es an der farbenübergabe liegt, die je nach wort ja anders ist.
wie sieht denn Deine Farbübergabe aus und wo ist sie eingebaut?

_________________
MfG Lannes
(Nichts ist nicht Nichts) and ('' <> nil ) and (Pointer('') = nil ) and (@('') <> nil )
Bondfreak Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 21

Win XP Prof, Kubuntu Dapper Drake
Delphi 6 (besitze auch 2005 und 2006)
BeitragVerfasst: Do 22.03.07 23:22 
ok jungs, hat sich erledigt...der fehler lag mal wieder beim user :( ich hab ausversehen meine globale variable für die abfrage der farbe nicht als referenzparameter übergeben, also wurde auch nix geändert >.<

trotzdem danke für eure hilfe ;)