Autor Beitrag
moloch
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 451

Win 2000
D5 Prof
BeitragVerfasst: Fr 01.10.04 09:06 
hey leute,

also eine horizontal trennlinie in einem Stringgrid kriege ich so schon hin.
aber ich möchte sie vertikal haben. Irgendwie schaffe ich das nicht.
Kann mir jemand helfen?
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
  if (aRow = 3) and not (gdFixed in State) then
  begin
    with (sender as tstringgrid).canvas do
    begin
      Pen.Color := clBlack;
      Pen.Width := 2;
      Pen.Style := psSolid;
      MoveTo(rect.left-1, rect.bottom);
      Lineto(rect.right-1, rect.bottom);
    end;
  end;


mfg
moloch

Moderiert von user profile iconChristian S.: Delphi-Tags hinzugefügt.
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: Fr 01.10.04 09:10 
Anmerkung: Nimm doch bitte Tags für deinen Source.

Zum Thema:
Welche Werte stehen denn in Rect? Und was geht denn nicht? Andersherum gefragt: Was passiert denn?
Jörg
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 71

Win 2000, Win XP
Delphi 1, 3, 5, 7
BeitragVerfasst: Fr 01.10.04 09:13 
Hab Deinen Code nicht getestet, aber wenn er für horizontale Linien funktioniert, dann ist das der Code für vertikale Linien:


ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
if (aRow = 3) and not (gdFixed in State) then
  begin
    with (sender as tstringgrid).canvas do
    begin
      Pen.Color := clBlack;
      Pen.Width := 2;
      Pen.Style := psSolid;
      MoveTo(rect.left-1, rect.top);
      Lineto(rect.left-1, rect.bottom);
    end;
  end;



Jörg.
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: Fr 01.10.04 09:20 
Sieht richtig aus. Hätte ich auch sehen müssen. Hatte nur nicht dran gedachct, dass das im DrawCell-Eereignis stattfindet. Dann sind die Werte natürlich klar.
Sorry, wegen der dämlichen Fragen.
moloch Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 451

Win 2000
D5 Prof
BeitragVerfasst: Fr 01.10.04 09:49 
also jetzt habe ich in jeder spalte einen vertikalen Strich so hoch wie die Zelle.
ich möchte einen Vertikalen strich durchs ganze grid bei spalte x

mfg

moloch
Jörg
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 71

Win 2000, Win XP
Delphi 1, 3, 5, 7
BeitragVerfasst: Fr 01.10.04 09:52 
Ist doch wirklich nicht schwer, oder?

Aus aRow wird aCol, dann funktioniert's. Hoffentlich war Dir die Frage wenigstens ein bißchen peinlich :wink:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
if (aCol = 3) and not (gdFixed in State) then  
  begin  
    with (sender as tstringgrid).canvas do  
    begin  
      Pen.Color := clBlack;  
      Pen.Width := 2;  
      Pen.Style := psSolid;  
      MoveTo(rect.left-1, rect.top);  
      Lineto(rect.left-1, rect.bottom);  
    end;  
  end;


Jörg.
moloch Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 451

Win 2000
D5 Prof
BeitragVerfasst: Fr 01.10.04 10:16 
ja du hast recht.
wenn man an etwas zu nah dran ist übersieht man manchmal das einfachste.
danke.

mfg
moloch
Jörg
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 71

Win 2000, Win XP
Delphi 1, 3, 5, 7
BeitragVerfasst: Fr 01.10.04 10:46 
Kein Thema. Bei den vielen Fragen zum StringGrid solltest Du ja jetzt das Super-StringGrid haben, oder?

Jörg.
moloch Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 451

Win 2000
D5 Prof
BeitragVerfasst: Fr 01.10.04 11:16 
also es wird langsam rund.
hoffe das andere auch davon profitieren können.

mfg
moloch