Autor Beitrag
DaK
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 16

Win 2000, Windows XP
Delphi 2007 Professional
BeitragVerfasst: Mi 03.01.07 00:21 
Ich arbeite momentan mit einem TStringgrid (wahlweise auch TDrawgrid), störe mich allerdings sehr am Markierungsrahmen, der automatisch über eine Zelle gesetzt wird, da ich den bei meinem Projekt überhaupt nicht gebrauchen kann. Gibt es eine Möglichkeit, diesen Markierungsrahmen irgendwie vollständig zu deaktivieren?
Coder
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 1383
Erhaltene Danke: 1

WinXP
D2005 PE
BeitragVerfasst: Mi 03.01.07 02:05 
Je nachdem was du mit dem StringGrid machst könnte es dir Helfen DefaultDrawing auf false zu setzen.
Dann musst du dich aber um das zeichnen der Zellen selber kümmern.

MfG
uwewo
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 154



BeitragVerfasst: Mi 03.01.07 09:00 
Hallo Dak,

ausblenden Delphi-Quelltext
1:
   StringGrid.Selection := TGridRect(Rect(-1, -1, -1, -1));					


sollte funktionieren.
DaK Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 16

Win 2000, Windows XP
Delphi 2007 Professional
BeitragVerfasst: Do 04.01.07 04:00 
@Coder dankeschön, dein Vorschlag hat mir sehr geholfen und ich bin richtig froh, dass die Markierung nun endlich weg ist :D :)

@uwewo Diese "Lösung" hatte ich vorher probiert, Problem ist allerdings, dass es ne Fehlermeldung gibt, sobald du aufs Grid klickst und die Maus dann aus dem Grid herausbewegst. Trotzdem danke ;)
Keldorn
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 2266
Erhaltene Danke: 4

Vista
D6 Prof, D 2005 Pro, D2007 Pro, DelphiXE2 Pro
BeitragVerfasst: Do 04.01.07 20:24 
Hallo,

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
procedure TForm1.FormCreate(Sender: TObject);
const  NoSelection: TGridRect =
                    (Left:-1; Top:-1; Right:-1; Bottom:-1 );
begin
 StringGrid1.Selection:=NoSelection;
end;

procedure TForm1.StringGrid1MouseWheelDown(Sender: TObject;
  Shift: TShiftState; MousePos: TPoint; var Handled: Boolean);
begin
  with Sender as Tstringgrid do
    begin
      //obere Reihe + angezeigte Reihen darf nicht größer sein, als die Gesamtreihen
      if TopRow+Visiblerowcount<rowcount then toprow:=toprow+1
    end;
  handled:=true;
end;

procedure TForm1.StringGrid1MouseWheelUp(Sender: TObject;
  Shift: TShiftState; MousePos: TPoint; var Handled: Boolean);
begin
  with Sender as Tstringgrid do
    begin
      if TopRow>fixedrows then toprow:=toprow-1
    end;
  handled:=true;
end;

Wheel-Ereignisse selber behandeln, dann kommt keine AV.

Mfg Frank

_________________
Lükes Grundlage der Programmierung: Es wird nicht funktionieren.
(Murphy)