Autor Beitrag
Flash106
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 234


D7 Ent
BeitragVerfasst: Fr 03.03.06 22:39 
Hallo,

ich möchte einmal per button klick ein stringgrid komplett selektieren und einmal verschiedene Zeilen die ich per strg + klick auswähle....
Wie kann ich das realisieren?! :)
digi_c
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1905

W98, XP
D7 PE, Lazarus, WinAVR
BeitragVerfasst: Sa 04.03.06 09:54 
Flash106 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 234


D7 Ent
BeitragVerfasst: Di 07.03.06 14:39 
hmmm... wie kann ich damit nicht zusammenhänge zeilen markieren? die ich mit strg + klick auswähle?? :(
Tastaro
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 414
Erhaltene Danke: 23



BeitragVerfasst: Di 07.03.06 14:46 
Entweder Selektieren selber basteln, durch selbst-zeichnen der Grids oder gar nicht.

Von sich aus gibt tstringgrid das nicht her.

Beste Grüße
Tastaro
Flash106 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 234


D7 Ent
BeitragVerfasst: Di 07.03.06 14:55 
selberzeichnen.... :( ....
hhmm... kennt einer ne besser combo? Die das kann... :( *verzweifel*
Tastaro
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 414
Erhaltene Danke: 23



BeitragVerfasst: Di 07.03.06 15:02 
tlistbox? Die kann das! :)

Beste Grüße
Tastaro
Flash106 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 234


D7 Ent
BeitragVerfasst: Di 07.03.06 15:28 
aber eine listbox hat nicht mehrere spalten...??? :(
chrisw
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 439
Erhaltene Danke: 3

W2K
D7
BeitragVerfasst: Di 07.03.06 15:32 
Das könnte man etwa so machen :

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
procedure TForm1.StringGrid1MouseDown(Sender: TObject;
  Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
  var Select : TGridRect;
begin
  if (getkeystate(vk_CONTROL) and 128)=128 then StringGrid1.Options := //Zeile auswählen  
                            StringGrid1.Options + [goRowSelect]
  else
  with StringGrid1 do
      begin  
        Select.Left := 1;
        Select.Right := ColCount;  
        Select.Top := 1;
        Select.Bottom := RowCount;  
        Options := Options - [goRowSelect];
        Selection := Select;  
      end;

end;

_________________
Man sollte keine Dummheit zweimal begehen, die Auswahl ist schließlich groß genug.


Zuletzt bearbeitet von chrisw am Mi 08.03.06 15:25, insgesamt 1-mal bearbeitet
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: Di 07.03.06 18:31 
Hallo,
user profile iconFlash106 hat folgendes geschrieben:
aber eine listbox hat nicht mehrere spalten...??? :(
nimm eine ListView, die kann mehrere Spalten und wenn die Eigenschaft MultiSelect auf True gesetzt ist kann man mehrere Zeilen selectieren.

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