Autor Beitrag
sarsel
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 21



BeitragVerfasst: Mi 23.08.06 10:11 
ich möchte in einem stringgrid einzelne zellen oder zellengruppen mit rahmen versehen.

weiß jemand ob und wie das geht oder kennt eine andere komponente mit dieser möglichkeit?
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 23.08.06 15:02 
Hallo,

wenn man den Code im OnDrawCell-Event des Stringgrids ausführt, wird die Zellgruppe der nicht fixierten Zellen mit einem blauen Rahmen versehen.
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
if (ACol >= StringGrid1.FixedCols) and (ARow >= StringGrid1.FixedRows) then 
    begin 
    StringGrid1.Canvas.Pen.Color := clBlue; 
    StringGrid1.Canvas.Rectangle(Rect.Left-1,Rect.Top-1,Rect.Right+1,Rect.Bottom+1); 
    StringGrid1.Canvas.TextOut(Rect.Left+2,Rect.Top+2,StringGrid1.Cells[ACol,ARow]); 
    end;

Mit entsprechenden gestellten Bedingungen und unter Verwendung von MoveTo/Lineto kannst Du das an deine Vorstellung anpassen.

bzgl. Komponentenauswahl kann ich Dir nicht weiterhelfen, ich benutze keine Grid-Komponente außer dem Standard-Grid, aber da gibt es bestimmt welche.

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