Club Delphi  
    Paypal   FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > Varios
Registrarse FAQ Miembros Calendario Guía de estilo Buscar Temas de Hoy Marcar Foros Como Leídos

Coloboración Paypal con ClubDelphi

 
 
Herramientas Buscar en Tema Desplegado
  #9  
Antiguo 11-11-2015
Avatar de ecfisa
ecfisa ecfisa is offline
Moderador
 
Registrado: dic 2005
Ubicación: Tres Arroyos, Argentina
Posts: 10.508
Poder: 38
ecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to beholdecfisa is a splendid one to behold
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

{ TDBGrid }
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 // (el alto que consideres razonable)
    begin
      FColsHeight := Value;
      TStringGrid(self).DefaultRowHeight := Value;
    end;
end;

end.

Uso del ejemplo:
Código Delphi [-]
unit Unit1;

interface

uses
  Windows, ...,  DBGrids, DBGridTitVert; //  incluir último !!

...

procedure TForm1.FormCreate(Sender: TObject);
begin
  DBGrid1.ColsHeight := 90;
end;
...

Muestra:


Saludos
__________________
Daniel Didriksen

Guía de estilo - Uso de las etiquetas - La otra guía de estilo ....

Última edición por ecfisa fecha: 11-11-2015 a las 23:52:17.
Responder Con Cita
 


Herramientas Buscar en Tema
Buscar en Tema:

Búsqueda Avanzada
Desplegado

Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro

Temas Similares
Tema Autor Foro Respuestas Último mensaje
Excel - Encabezado shoulder Varios 2 14-02-2013 17:21:01
insertar registro en un grid que esta en otro grid @-Soft SQL 7 20-02-2008 17:22:42
la computacion grid en accion - world community grid nightynvid La Taberna 0 04-01-2007 17:33:44
Encabezado XML bumiga Internet 0 04-01-2006 16:33:28
Encabezado del reporte cmgenny Impresión 1 11-05-2003 09:54:36


La franja horaria es GMT +2. Ahora son las 17:24:34.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi