Hola will_ramone.
Fijate si lo que estas buscando es algo como esto:
Código Delphi
[-]
unit DBGridTitVert;
interface
uses Windows, Types, Graphics, Grids, DBGrids;
type
TDBGrid = class(DBGrids.TDBGrid)
private
FColsHeight : Integer;
procedure SetColsHeight(const Value: Integer);
protected
procedure DrawCell(ACol, ARow: Integer; ARect: TRect; State: TGridDrawState); override;
public
property ColsHeight: Integer read FColsHeight write SetColsHeight;
end;
implementation
procedure TDBGrid.DrawCell(ACol, ARow: Integer; ARect: TRect;
State: TGridDrawState);
var
LF : LOGFONT;
CurrentCol : TColumn;
FontName : string;
begin
if (ARow = FixedRows-1) and (ACol >= Integer(dgIndicator in Options)) then
begin
CurrentCol := Columns[ACol-1];
FontName := CurrentCol.Title.Font.Name;
ZeroMemory(@LF, SizeOf(LF));
LF.lfHeight := Canvas.Font.Height ;
LF.lfWidth := Canvas.Font.Size;
LF.lfEscapement := 10 * 90;
LF.lfCharSet := CurrentCol.Font.Charset;
Move(FontName, LF.lfFaceName, Length(FontName));
Canvas.Brush.Color := CurrentCol.Title.Color;
Canvas.Brush.Style := bsSolid;
Canvas.FillRect(ARect);
Canvas.Font.Handle:= CreateFontIndirect(LF);
Canvas.TextOut(ARect.Left + (ARect.Right - ARect.Left) div 2 - LF.lfWidth,
ARect.Bottom + LF.lfHeight, CurrentCol.Title.Caption);
end
else
inherited;
end;
procedure TDBGrid.SetColsHeight(const Value: Integer);
begin
if Value <> FColsHeight then
if Value > 30 then begin
FColsHeight := Value;
TStringGrid(self).DefaultRowHeight := Value;
end;
end;
end.
Uso del ejemplo:
Código Delphi
[-]
unit Unit1;
interface
uses
Windows, ..., DBGrids, DBGridTitVert;
...
procedure TForm1.FormCreate(Sender: TObject);
begin
DBGrid1.ColsHeight := 90;
end;
...
Muestra:
Saludos