Ver Mensaje Individual
  #5  
Antiguo 15-04-2015
Avatar de pacopenin
pacopenin pacopenin is offline
Miembro
 
Registrado: sep 2010
Ubicación: Asturias
Posts: 382
Reputación: 14
pacopenin Va por buen camino
Efectivamente. La propiedad Tag es tal cual la explica AgustinOrtu.

Te pongo un ejemplo de como lo hago.

Código Delphi [-]
procedure TFBscInventario.JvPanel1Resize(Sender: TObject);
var
 l : Integer;
begin
  inherited;
  l := smDBGridLin.Width - 175;
  smDBGridLin.Columns[0].Width := (l * smDBGridLin.Columns[0].Tag) div 100;
  smDBGridLin.Columns[1].Width := (l * smDBGridLin.Columns[1].Tag) div 100;
end;

o así.

Código Delphi [-]
procedure TFFacturaVenta.FormResize(Sender: TObject);
var
 i, l, tot : Integer;
begin
  inherited;
  l := smDBGridUI.Width - 27;
  tot := 0;
  for i := 0 to smDBGridUI.Columns.Count - 2 do
   begin
    smDBGridUI.Columns[i].Width := (l * smDBGridUI.Columns[i].Tag) div 100;
    Tot := Tot + smDBGridUI.Columns[i].Width;
   end;
  smDBGridUI.Columns[(smDBGridUI.Columns.Count - 1)].Width := l - Tot;
end;

Ésta última lo que hace es que ajusta la última columna al ancho restante.
__________________
http://www.gestionportable.com
Responder Con Cita