Autor Beitrag
Uli Schoch
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 81



BeitragVerfasst: Do 13.05.04 08:40 
Hallo
In einem Formular (Delphi 3) habe ich ein Stringgrid, in welchem ich Daten anzeige, die von der Schnittstelle eingelesen werden. In diesem Stringgrid ist immer die Zelle oben links blau hinterlegt, alle anderen sind weiss. Kann man das "blau" ausschalten? Von Hand muss ich nie Daten ins Stringgrid eingeben.

Gruss Uli
bms
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 735

Win XP
Delphi 3, Delphi 6 PE, Delphi 2005 PE
BeitragVerfasst: Do 13.05.04 08:58 
Meinst du die fixen Zeilen und Spalten?

_________________
VORSICHT: Ich behersche seit heute die Fünf-Finger-Handflächen-Herz-Explodier-Schlag-Kampf-Technik >:(
Sven
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 314


D6 Ent, K3 Pro (patched)
BeitragVerfasst: Do 13.05.04 09:27 
bms hat folgendes geschrieben:
Meinst du die fixen Zeilen und Spalten?


Nein, die aktuell ausgewählte Zelle!

_________________
MDK 9.1, Kernel 2.4.21, KDE 3.1 Kylix 3 Pro (patched), nutze aber auch Windows
Aton
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 125

Windows XP
D7 Enterprise
BeitragVerfasst: Do 13.05.04 09:51 
Hallo du,

hatte dieses Problem auch mal. :P

Leider habe ich noch eine Lösung "hingebogen bekommen": :(

Also:
1. Du setzt die selektierte Zelle auch 0,0. Da sind i.d.R. die 3d-Balken und es wird nicht blau gezeichnet.

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
procedure TForm1.FormActivate(Sender: TObject);
begin
  StringGrid1.Row := 0;
  StringGrid1.Col := 0;
end;


2. Bei onSelectCell kannst du noch einstellen, dass niemals eine Zelle selektiert werden darf.

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
procedure TForm1.StringGrid1SelectCell(Sender: TObject; ACol,
  ARow: Integer; var CanSelect: Boolean);
begin
  CanSelect := False;
end;


3. Beim StringGrid: Options/goRangeSelect auf False stellen.

Wie gesagt, ist nur hingebogen. Wenn es eine bessere Lösung gibt, das blaue Feld verschwinden zu lassen, würde mich das auch interessieren. :wink:

Gruß Jens.
Uli Schoch Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 81



BeitragVerfasst: Do 13.05.04 13:34 
Hallo Jens
Deine "hingebogenen" Vorschläge funktionieren leider nicht! Hast du oder sonst jemand andere Lösungen? Wäre schön.

Gruss
Uli
Sven
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 314


D6 Ent, K3 Pro (patched)
BeitragVerfasst: Do 13.05.04 13:39 
Tja, ich glaube da mußt Du dann die Zellen bei OnDrawCell selber zeichnen. Gegebenenfalls OwnerDraw auf true stellen.

_________________
MDK 9.1, Kernel 2.4.21, KDE 3.1 Kylix 3 Pro (patched), nutze aber auch Windows
smiegel
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 992
Erhaltene Danke: 1

WIN 7
D7 Prof., C#, RAD XE Prof.
BeitragVerfasst: Do 13.05.04 13:51 
Hallo,

wenn Du in Options goEditing auf False setzt, funktioniert folgendes:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
// in der OnCreate des Formulars:
...
StringGrid1.Selection:=TGridRect(Bounds(-1, -100));
...

_________________
Gruß Smiegel
Ich weiß, daß ich nichts weiß, aber ich weiß mehr als die, die nicht wissen, daß sie nichts wissen. (Sokrates)
Uli Schoch Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 81



BeitragVerfasst: Do 13.05.04 19:13 
Salü Smiegel
Das mit dem Bounds funktioniert, ich weiss zwar nicht warum, aber jetzt siehts echt schön aus.

Vielen Dank
Uli
Freeman_6
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 19



BeitragVerfasst: Mo 18.10.04 17:41 
hi,

hat in der zwischenzeit auch jemand eine lösung für goedit := true gefunden?

könnte das wirklich gut gebrauchen.
µaTh
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: So 26.02.06 16:24 
Heureka!!!!

bei stringgrid optionen: goediting und alwaysshoweditor auf true

mfg
µaTh

P.S. ich weiß der thread ist ewas alt, aber ich hab es trotzdem rausgefunden :dance: :dance2: :beer: