Autor Beitrag
Martoeng
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 25



BeitragVerfasst: Do 06.05.04 14:35 
Hi,

wie kann ich in einem DBGrid (oder auch StringGrid) die Spaltenbreite festlegen?

Hab schon hundertmal dieses und auch andere Foren durchsucht, bin aber zu keinem Ergebnis gekommen.

Kann mir da jemand weiterhelfen?


THX u. Greetz

Martoeng
Aton
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 125

Windows XP
D7 Enterprise
BeitragVerfasst: Fr 07.05.04 07:23 
Hallo du,

beim DBGrid geht es so:

ausblenden Delphi-Quelltext
1:
2:
DBGrid.Columns[0].Width := 50;
DBGrid.Columns[1].Width := 50;


bei StringGrid geht es so:

ausblenden Delphi-Quelltext
1:
2:
StringGrid.ColWidth[0] := 50;
StringGrid.ColWidth[1] := 50;


Und das stand nicht in der Delphi Hilfe? :wink:

Gruß Jens.
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: Fr 07.05.04 08:20 
Hallo,

da ist Aton ein kleiner Fehler unterlaufen.

Die Breite von Stringgridspalten bestimmt man wie folgt:
ausblenden Delphi-Quelltext
1:
2:
StringGrid.ColWidths[0] := 50; 
StringGrid.ColWidths[1] := 50;

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

Windows XP
D7 Enterprise
BeitragVerfasst: Fr 07.05.04 08:40 
Oops :oops:,
du hast natürlich Recht.