Fórum eliminar espaço em brando no dbgrid #640
19/11/2008
0
Nirlan Fundao
Curtir tópico
+ 0Posts
20/11/2008
Guinther Pauli
Gostei + 0
20/11/2008
Nirlan Fundao
Não é isso. O DBGBRID já está com allCliente. Me refiro ao espaço dentro do dbgrid. Veja a imagem em anexo.
Gostei + 0
20/11/2008
Guinther Pauli
Gostei + 0
20/11/2008
Nirlan Fundao
procedure TDM.fixDBGridColumnsWidth(const DBGRID: TevDBGRID3d);
var
i: integer;
vTotWidth : integer;
vVarWidth : integer;
vColumn : tcolumn;
vResizablecolumncount : integer;
begin
// largura total de todas as colunas antes do redimensionamento
vTotWidth := 0;
// quantas colunas precisam de auto-redimensionamento
vResizableColumnCount := 0;
for i := 0 to -1 + DBGRID.Columns.Count do
begin
vTotWidth := vTotWidth + DBGRID.Columns[i].Width;
if DBGRID.Columns[i].Field.Tag <> 0 then
Inc(vResizableColumnCount);
end;
// adiciona 1px para a linha de separação de colunas
if dgcollines in DBGRID.Options then
vTotWidth := vTotWidth + DBGRID.Columns.Count;
// adiciona indicador de largura
if dgIndicator in DBGRID.Options then
vTotWidth := vTotWidth + IndicatorWidth;
// largura recebe o valor de "left"
vVarWidth := DBGRID.ClientWidth - vTotWidth;
// distribuição por igual da vVarWidth
// para todas as colunas auto-redimensionáveis
if vResizableColumnCount > 0 then
vVarWidth := vVarWidth div vResizableColumnCount;
for i := 0 to -1 + DBGRID.Columns.Count do
begin
vColumn := DBGRID.Columns[i];
if vColumn.Field.tag <> 0 then
begin
vColumn.Width := vColumn.Width + vVarWidth;
if vColumn.Width < vColumn.Field.Tag then
vColumn.Width := vColumn.Field.Tag;
end;
end;
end;
Podemos encerrrar este chamado.
Gostei + 0
Clique aqui para fazer login e interagir na Comunidade :)