AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

stringgrid Zellenrahmen

Ein Thema von Matthias-k · begonnen am 26. Sep 2005 · letzter Beitrag vom 29. Sep 2005
Antwort Antwort
Seite 2 von 2     12   
Benutzerbild von ibp
ibp

Registriert seit: 31. Mär 2004
Ort: Frankfurt am Main
1.511 Beiträge
 
Delphi 7 Architect
 
#11

Re: stringgrid Zellenrahmen

  Alt 27. Sep 2005, 09:24
auf der Seite von TMS gibt es ein Beispiel!

Zitat:
TAdvStringGrid example 43 : advanced border control

In earlier versions of TAdvStringGrid, it was not possible to specify different border colors and widths for a single cell. It was only possible to specify which border to draw (left, top, bottom, right)

In addition to the OnGetCellBorder event with which you can specify which borders to draw, an extra event is now available, OnGetCellBorderProp through which the pen can be set for the left, top, bottom and right border of the cell.

How the 2 events work together is shown in the following example:


procedure TForm1.AdvStringGrid1GetCellBorder(Sender: TObject; ARow,
ACol: Integer; APen: TPen; var Borders: TCellBorders);
begin
if not Odd(ACol) and (ARow > 0) and (ACol > 0) then
begin
Borders := [cbLeft];
APen.Width := 1;
APen.Color := clBlack;
end;

if not Odd(ARow) and (ARow > 0) and (ACol > 0) then
begin
Borders := Borders + [cbBottom];
APen.Width := 1;
APen.Color := clBlack;
end;
end;

The above event handler makes sure that a left and bottom border of the cell are only drawn for all even rows. The specify that the left border should be drawn in a blue color and the bottom border in a red color, the OnGetCellBorderProp method is used :

procedure TForm1.AdvStringGrid1GetCellBorderProp(Sender: TObject; ARow,
ACol: Integer; LeftPen, TopPen, RightPen, BottomPen: TPen);
begin
LeftPen.Color := clBlue;

BottomPen.Color := clRed;
end;
  Mit Zitat antworten Zitat
Benutzerbild von ibp
ibp

Registriert seit: 31. Mär 2004
Ort: Frankfurt am Main
1.511 Beiträge
 
Delphi 7 Architect
 
#12

Re: stringgrid Zellenrahmen

  Alt 28. Sep 2005, 16:14
und wie hast du es nun gelöst?
  Mit Zitat antworten Zitat
Matthias-k

Registriert seit: 7. Jul 2005
Ort: Freiberg
75 Beiträge
 
Delphi 7 Professional
 
#13

Re: stringgrid Zellenrahmen

  Alt 29. Sep 2005, 08:57
hi ibp,

zu meiner svchande muss ich gestehen, das ich es noch nicht probieren konnte!

ich habs allerdings mal kurz in meiner pause antesten können! schaut interesannt aus!

muss ich allerdings erst unter laufzeit bedingungen testen!


dank dir aber!

hatte mir die tips auch durchgeschaut von tms, aber hab des komplett übersehen!

Matthias
  Mit Zitat antworten Zitat
Antwort Antwort
Seite 2 von 2     12   


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 23:03 Uhr.
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz