Ver Mensaje Individual
  #2  
Antiguo 03-11-2010
Avatar de ecfisa
ecfisa ecfisa is offline
Moderador
 
Registrado: dic 2005
Ubicación: Tres Arroyos, Argentina
Posts: 10.508
Reputación: 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 lucas.

El tamaño lo cambias con la propiedad TDBGrid.Font.Size y la alineación debés hacerla para cada columna TDBGrid.Columns[n].Alignment, valores: taLeftJustify, taCenter o taRightJustify.

Como ejemplo de prueba, en un form pone:
. Un TDBGrid asociado asociado a un TDataSource relacionado a un TDataSet. (Table,Query,etc)
. Un TRadioGroup con sus Items en este orden: Izquierda, Derecha y Centrado.
. Un TUpDow (pestaña Win32) con su propiedad Asociate = Edit1 y las propiedades: Min = 8, Max =24.

Código Delphi [-]
...
type
  TForm1 = class(TForm)
    DataSource1: TDataSource;
    Table1: TTable;
    DBGrid1: TDBGrid;
    RadioGroup1: TRadioGroup;
    UpDown1: TUpDown;
    Edit1: TEdit;
    procedure RadioGroup1Click(Sender: TObject);
    procedure UpDown1Changing(Sender: TObject; var AllowChange: Boolean);
  private
  public
  end;

var
  Form1: TForm1;

implementation {$R *.dfm}

procedure TForm1.RadioGroup1Click(Sender: TObject);
var
  i: Integer;
  TA: TAlignment;
begin
  case RadioGroup1.ItemIndex of
    0: TA:= taLeftJustify;     // izquierda
    1: TA:= taRightJustify;  // derecha
    2: TA:= taCenter;         // centro 
  end;
  for i:= 0 to DBGrid1.Columns.Count -1 do  //  todas las columnas
    DBGrid1.Columns[i].Alignment:= TA;      // Alinear
end;

procedure TForm1.UpDown1Changing(Sender: TObject;
  var AllowChange: Boolean);
begin
  DBGrid1.Font.Size:=  UpDown1.Position; // Tamaño fuente
end;
...

Saludos.

Última edición por ecfisa fecha: 03-11-2010 a las 04:29:15.
Responder Con Cita