Главная страница
    Top.Mail.Ru    Яндекс.Метрика
Форум: "Начинающим";
Текущий архив: 2008.06.08;
Скачать: [xml.tar.bz2];

Вниз

Dbgid- проблема с шириной столбцов   Найти похожие ветки 

 
kupidon ©   (2008-05-15 05:49) [0]

Приветствую всех. Вопрос: имеется таблица dbgid. растягиваю ширину столбцов на требуемую - все работает прекрасно. На другой день запускаю делфи, запускаю программу- ширины столбцов- как попало. Что может быть?
Пробовал и в инспекторе на столбцы ширину устанавливать- работает нормально, но до поры до времени. :(


 
Vlad Oshin ©   (2008-05-15 09:57) [1]

procedure setgridcolumnwidths(grid: tdbgrid);
const
defborder = 10;
var
temp, n: integer;
lmax: array [0..30] of integer;
begin
with grid do
begin
 canvas.font := font;
 for n := 0 to columns.count - 1 do //if columns[n].visible then
                        lmax[n] := canvas.textwidth(fields[n].fieldname) + defborder;
 grid.datasource.dataset.first;
 while not grid.datasource.dataset.eof do
 begin
   for n := 0 to columns.count - 1 do
   begin
     //if columns[n].visible then begin
     temp := canvas.textwidth(trim(columns[n].field.displaytext)) + defborder;
     if temp > lmax[n] then lmax[n] := temp;
     //end; { if }
   end; {for}
   grid.datasource.dataset.next;
 end; { while }
grid.datasource.dataset.first;
for n := 0 to columns.count - 1 do
                 if lmax[n] > 0 then columns[n].width := lmax[n];
end; { with }
end; {setgridcolumnwidths }


 
Vlad Oshin ©   (2008-05-15 09:57) [2]

procedure setgridcolumnwidths(grid: tdbgrid);
const
defborder = 10;
var
temp, n: integer;
lmax: array [0..30] of integer;
begin
with grid do
begin
 canvas.font := font;
 for n := 0 to columns.count - 1 do //if columns[n].visible then
                        lmax[n] := canvas.textwidth(fields[n].fieldname) + defborder;
 grid.datasource.dataset.first;
 while not grid.datasource.dataset.eof do
 begin
   for n := 0 to columns.count - 1 do
   begin
     //if columns[n].visible then begin
     temp := canvas.textwidth(trim(columns[n].field.displaytext)) + defborder;
     if temp > lmax[n] then lmax[n] := temp;
     //end; { if }
   end; {for}
   grid.datasource.dataset.next;
 end; { while }
grid.datasource.dataset.first;
for n := 0 to columns.count - 1 do
                 if lmax[n] > 0 then columns[n].width := lmax[n];
end; { with }
end; {setgridcolumnwidths }


 
Vlad Oshin ©   (2008-05-15 09:57) [3]

procedure setgridcolumnwidths(grid: tdbgrid);
const
defborder = 10;
var
temp, n: integer;
lmax: array [0..30] of integer;
begin
with grid do
begin
 canvas.font := font;
 for n := 0 to columns.count - 1 do //if columns[n].visible then
                        lmax[n] := canvas.textwidth(fields[n].fieldname) + defborder;
 grid.datasource.dataset.first;
 while not grid.datasource.dataset.eof do
 begin
   for n := 0 to columns.count - 1 do
   begin
     //if columns[n].visible then begin
     temp := canvas.textwidth(trim(columns[n].field.displaytext)) + defborder;
     if temp > lmax[n] then lmax[n] := temp;
     //end; { if }
   end; {for}
   grid.datasource.dataset.next;
 end; { while }
grid.datasource.dataset.first;
for n := 0 to columns.count - 1 do
                 if lmax[n] > 0 then columns[n].width := lmax[n];
end; { with }
end; {setgridcolumnwidths }



Страницы: 1 вся ветка

Форум: "Начинающим";
Текущий архив: 2008.06.08;
Скачать: [xml.tar.bz2];

Наверх





Память: 0.45 MB
Время: 0.041 c
15-1208864165
vajo
2008-04-22 15:36
2008.06.08
Какие существуют офисные программы для Symbian 9.2?


15-1209115765
@!!ex
2008-04-25 13:29
2008.06.08
Как работать с libpng???


2-1210761585
MZG
2008-05-14 14:39
2008.06.08
Программа и память


2-1210854738
Tommy
2008-05-15 16:32
2008.06.08
MySQL и Delphi


15-1209321298
worldmen
2008-04-27 22:34
2008.06.08
Компиляция файла помощи через HCW.EXE





Afrikaans Albanian Arabic Armenian Azerbaijani Basque Belarusian Bulgarian Catalan Chinese (Simplified) Chinese (Traditional) Croatian Czech Danish Dutch English Estonian Filipino Finnish French
Galician Georgian German Greek Haitian Creole Hebrew Hindi Hungarian Icelandic Indonesian Irish Italian Japanese Korean Latvian Lithuanian Macedonian Malay Maltese Norwegian
Persian Polish Portuguese Romanian Russian Serbian Slovak Slovenian Spanish Swahili Swedish Thai Turkish Ukrainian Urdu Vietnamese Welsh Yiddish Bengali Bosnian
Cebuano Esperanto Gujarati Hausa Hmong Igbo Javanese Kannada Khmer Lao Latin Maori Marathi Mongolian Nepali Punjabi Somali Tamil Telugu Yoruba
Zulu
Английский Французский Немецкий Итальянский Португальский Русский Испанский