Главная страница
Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2002.05.06;
Скачать: CL | DM;

Вниз

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

 
Ник   (2002-04-11 21:34) [0]

Подскажите такой хороший Grid. DBGridEh не подходит.


 
Vitek_m   (2002-04-12 05:16) [1]

Можно используя и обычный Grid или же есть хороший ExpressQuantumGrid который может многое.....

procedure AutoSizeGridColumn(Grid : TStringGrid; column : integer);
var
i : integer;
temp : integer;
max : integer;
begin
max := 0;
for i := 0 to (Grid.RowCount - 1) do
begin
temp := Grid.Canvas.TextWidth(grid.cells[column, i]);
if temp > max then max := temp;
end;
Grid.ColWidths[column] := Max + Grid.GridLineWidth + 3;
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
AutoSizeGridColumn(StringGrid1, 1);
end;




 
Lusha ©   (2002-04-12 10:20) [2]

Попробуйте такой обработчик...

type TMyDBGrid = class(TDBGrid);

...

procedure TForm1.GridMouseUp(Sender : TObject; Button : TMouseButton; Shift : TShiftState; X, Y : Integer);
var Cell : TGridCoord;
begin
with TMyDbGrid(Sender) do
if Sizing(X, Y) then
begin
Cell := MouseCoord(X, Y);
if dgIndicator in Options then dec(Cell.X);
DefaultColWidth := Columns[Cell.X].Width;
ShowMessage();
end;
end;


 
Lusha ©   (2002-04-12 10:23) [3]

Гы-гы. ShowMessage нужно убрать - это меня колбасит... :)



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

Текущий архив: 2002.05.06;
Скачать: CL | DM;

Наверх




Память: 0.47 MB
Время: 0.071 c
7-17711
davile
2002-02-09 15:26
2002.05.06
COM порт


4-17735
guliver
2002-02-28 01:52
2002.05.06
String to PChar


1-17571
cypher
2002-04-21 22:42
2002.05.06
Как вставить TPicture в панель TStatusBarэ


1-17570
HDD
2002-04-22 05:43
2002.05.06
Помогите пожалуйста


14-17680
-=CrazyFish=-
2002-03-26 15:09
2002.05.06
АОН