AGB  ·  Datenschutz  ·  Impressum  







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

TStringGrid inner margin

Ein Thema von sk.Silvia · begonnen am 8. Feb 2006 · letzter Beitrag vom 8. Feb 2006
Antwort Antwort
Benutzerbild von sk.Silvia
sk.Silvia

Registriert seit: 8. Feb 2006
Ort: Slovenia
90 Beiträge
 
Delphi 7 Personal
 
#1

TStringGrid inner margin

  Alt 8. Feb 2006, 16:59
hi all

how can i change the margin in TStringGrid component?

see picture below (i mean how to set the space between the grid border and char to 0)
http://www.politea.sk/data/stringgridproblem.jpg

thank you, for your creative solutions...
  Mit Zitat antworten Zitat
Benutzerbild von sk.Silvia
sk.Silvia

Registriert seit: 8. Feb 2006
Ort: Slovenia
90 Beiträge
 
Delphi 7 Personal
 
#2

Re: TStringGrid inner margin

  Alt 8. Feb 2006, 17:02
ehm wie kann ich den margin zchischen den linien und den symbol auf 0 zetzen, sodas kein freier raum dazwichen ist!

danke
  Mit Zitat antworten Zitat
marabu

Registriert seit: 6. Apr 2005
10.109 Beiträge
 
#3

Re: TStringGrid inner margin

  Alt 8. Feb 2006, 17:36
Welcome to our community, Silvia.

The gap you object to is produced by the default drawing method of the cell. If you have an event handler for the OnDrawCell() event you can set horizontal and vertical gaps at will:

Delphi-Quellcode:
procedure TDemoForm.StringGridDrawCell(Sender: TObject; ACol,
  ARow: Integer; Rect: TRect; State: TGridDrawState);
const
  hGap = 0;
  vGap = 0;
begin
  with Sender as TStringGrid do
  begin
    Canvas.FillRect(Rect);
    TextOut(Canvas.Handle, Rect.Left + hGap, Rect.Top + vGap,
      PAnsiChar(Cells[ACol, ARow]), Length(Cells[ACol, ARow]));
  end;
end;
Kind regards

marabu
  Mit Zitat antworten Zitat
Benutzerbild von sk.Silvia
sk.Silvia

Registriert seit: 8. Feb 2006
Ort: Slovenia
90 Beiträge
 
Delphi 7 Personal
 
#4

Re: TStringGrid inner margin

  Alt 8. Feb 2006, 18:18
Great thank you soooo much))
  Mit Zitat antworten Zitat
Antwort Antwort


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 02:19 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