Autor Beitrag
steppenwolf
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 38



BeitragVerfasst: Do 28.04.05 10:25 
Hallo allerseits,

trotz Suchfunktion habe ich leider keine Antwort gefunden bzgl. folgendem Problem: Wie kann ich feststellen, ob eine (oder mehrere) Zellen eines Stringgrids 'aktiv' sind oder nicht?

Danke im Voraus und auf bald ...
steppenwolf.
jasocul
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 6395
Erhaltene Danke: 149

Windows 7 + Windows 10
Sydney Prof + CE
BeitragVerfasst: Do 28.04.05 10:30 
Die Aktive Spalte und Zeile kannst du feststellen und dadurch die Zelle:
ausblenden Delphi-Quelltext
1:
2:
  AktiveSpalte := StringGrid1.Col;
  Aktivezeile := StringGrid1.Row;
steppenwolf Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 38



BeitragVerfasst: Mi 04.05.05 15:30 
Hallo,

wenn auch verspätet, vielen Dank für die Antwort.

Für eine einzelne Zelle konnte ich das Beispiel nachvollziehen.

Mein Problem: Wie schaut es mit einer Mehrfachauswahl aus?

Auf bald ...
steppenwolf.
jasocul
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 6395
Erhaltene Danke: 149

Windows 7 + Windows 10
Sydney Prof + CE
BeitragVerfasst: Mi 04.05.05 15:57 
Das geht über:
ausblenden Delphi-Quelltext
1:
StringGrid1.Selection					

Das ist für Range-Select. Multi-Select ist mir bei StringGrid nicht bekannt (Delphi 5).
Weiter Infos bekommst du aus der Delphi-Hilfe.
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 04.05.05 16:01 
Hallo,

war ich wohl etwas langsamer, aber trotzdem.
Das sollte Dir alles was Du brauchst anzeigen:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
var
  myRect: TGridRect;
begin
  myRect := StringGrid1.Selection;
  showmessage('Top: '+IntToStr(myRect.Top)+#10#13
             +'Left: '+IntToStr(myRect.Left)+#10#13
             +'Right: '+IntToStr(myRect.Right)+#10#13
             +'Bottom: '+IntToStr(myRect.Bottom)+#10#13
             +'AktiveSpalte: '+IntToStr(StringGrid1.Col)+#10#13
             +'Aktivezeile: '+IntToStr(StringGrid1.Row));

_________________
MfG Lannes
(Nichts ist nicht Nichts) and ('' <> nil ) and (Pointer('') = nil ) and (@('') <> nil )