Autor Beitrag
sintec
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 133



BeitragVerfasst: Mi 13.06.07 10:58 
Hallo alle zusammen

Wie schon im Topic beschrieben liefert mir StringGrid.Col was falsches.

in der Zeile:
ausblenden Delphi-Quelltext
1:
col := stringgrid1.Col;					

bekomme ich immer eine 1 egal in welcher Spalte ich eine Zelle markiere.

komischerweise funktioniert
ausblenden Delphi-Quelltext
1:
row := stringgrid1.Row;					

wunderbar


Damit möchte ich die Koordinaten der markierten Zelle herausfinden.


Kann mir einer sagen warum es nicht funktioniert?
ZeitGeist87
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1593
Erhaltene Danke: 20

Win95-Win10
Delphi 10 Seattle, Rad Studio 2007, Delphi 7 Prof., C++, WSH, Turbo Pascal, PHP, Delphi X2
BeitragVerfasst: Mi 13.06.07 11:16 
Was gibt StringGrid1.ColCount?

_________________
Wer Provokationen, Ironie, Sarkasmus oder Zynismus herauslesen kann soll sie ignorieren um den Inhalt meiner Beiträge ungetrübt erfassen zu können.
sintec Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 133



BeitragVerfasst: Mi 13.06.07 11:56 
Ach ich habs hingekriegt, musste nur die Eigenschaft goRowSelect auf false stellen.

Das Problem ist jetzt nur, dass es die Zelle selektiert aber nicht blau markiert.

Kann mir eine ein Tipp geben?
ZeitGeist87
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1593
Erhaltene Danke: 20

Win95-Win10
Delphi 10 Seattle, Rad Studio 2007, Delphi 7 Prof., C++, WSH, Turbo Pascal, PHP, Delphi X2
BeitragVerfasst: Mi 13.06.07 11:58 
user profile iconsintec hat folgendes geschrieben:
Kann mir eine ein Tipp geben?


Da muss ich mich wohl ausschließen --> männlich :)

_________________
Wer Provokationen, Ironie, Sarkasmus oder Zynismus herauslesen kann soll sie ignorieren um den Inhalt meiner Beiträge ungetrübt erfassen zu können.
sintec Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 133



BeitragVerfasst: Mi 13.06.07 12:07 
user profile iconZeitGeist87 hat folgendes geschrieben:
user profile iconsintec hat folgendes geschrieben:
Kann mir eine ein Tipp geben?


Da muss ich mich wohl ausschließen --> männlich :)


sorry, Tastatur klemmt manchmal

sollte natürlich einer heißen :D
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: Mi 13.06.07 12:21 
Hallo,
user profile iconsintec hat folgendes geschrieben:
user profile iconZeitGeist87 hat folgendes geschrieben:
user profile iconsintec hat folgendes geschrieben:
Kann mir eine ein Tipp geben?


Da muss ich mich wohl ausschließen --> männlich :)

sorry, Tastatur klemmt manchmal
sollte natürlich einer heißen :D
aber wer wird denn gleich die weiblichen Foren-User ausschließen :mrgreen:

Damit die focussierte Zelle blau wird musst man selbst das Zeichnen übernehmen.
Da bietet sich OnDrawCell an. In dem Event-Handler kannst Du State abfragen und darauf reagieren.

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
if gdFocused in State then
  begin
  // Canvas.Brush.Color setzen
  // Zelle mit Fillrect übermalen
  // Text ausgeben z.B. mit TextOut oder DrawText
  end

_________________
MfG Lannes
(Nichts ist nicht Nichts) and ('' <> nil ) and (Pointer('') = nil ) and (@('') <> nil )
ZeitGeist87
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1593
Erhaltene Danke: 20

Win95-Win10
Delphi 10 Seattle, Rad Studio 2007, Delphi 7 Prof., C++, WSH, Turbo Pascal, PHP, Delphi X2
BeitragVerfasst: Mi 13.06.07 12:22 
:P kleiner Scherz am Rande!

Gehst du das Grid ...

natoll :)

Lannes war schneller :P

_________________
Wer Provokationen, Ironie, Sarkasmus oder Zynismus herauslesen kann soll sie ignorieren um den Inhalt meiner Beiträge ungetrübt erfassen zu können.
sintec Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 133



BeitragVerfasst: Mi 13.06.07 13:17 
Vielen Dank an euch beide.

Ich habe es gelöst, in dem ich die Eigenschaft goDrawFocusSelected vom StringGrid auf true gesetzt habe.