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

Вниз

Объединение ячеек в StringGrid   Найти похожие ветки 

 
FRT   (2003-06-16 11:42) [0]

Подскажите пожайлуста процедурку объединяющую ячейки
в StringGrid. Если такой нету, какой нибудь выход из положения?


 
clickmaker ©   (2003-06-16 11:56) [1]

Искать компоненты. На torry.ru или http://www.tmssoftware.com. На Торри вроде бы лежал компонентик XLGrid, имитирующий лист Excel


 
___Nikolay ©   (2003-06-16 14:41) [2]


procedure TForm1.StringGrid1DrawCell(Sender: TObject; ACol, ARow: Integer;
Rect: TRect; State: TGridDrawState);
var
i, x, y: Integer;
begin
if gdFixed in State then
Exit;
if ARow > 1 then
Exit;
{Draw row 1 with text from cell 1,1 spanning all cells in the row}
with sender as TStringGrid do
begin
{Extend rect to include grid line on right, if not last cell in row}
if aCol < Pred(ColCount) then
Rect.Right := Rect.Right + GridlineWidth;
{Figure out where the text of the first cell would start
relative to the current cells rect}
y := Rect.Top + 2;
x := Rect.Left + 2;
for i:= 1 to aCol - 1 do
x := x - ColWidths[i] - GridlineWidth;
{Paint cell pale yellow}
Canvas.Brush.Color := $7FFFFF;
Canvas.Brush.Style := bsSolid;
Canvas.FillRect( Rect );
{Paint text of cell 1,1 clipped to current cell}
Canvas.TextRect( Rect, x, y, Cells[1, 1] );
end;
end;


И ещё так:


procedure TForm1.FormCreate(Sender: TObject);
var
i, k: Integer;
begin
with StringGrid1 do
begin
cells[1, 1] := "A rather long line which will span cells";
for i:= 1 to colcount-1 do
for k:= 2 to rowcount -1 do
cells[i,k] := Format( "Cell[%d, %d]", [i, k]);
end;
end;



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

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

Наверх




Память: 0.47 MB
Время: 0.018 c
14-84726
neuro
2003-06-05 19:20
2003.06.26
Tcl/Tk, Awk...


8-84453
Dimonich
2003-03-03 18:26
2003.06.26
Музыкальный пригрыватель


14-84624
VEG
2003-06-07 20:27
2003.06.26
Что-то пропала посещаемость сайта...


14-84621
DiamondShark
2003-06-04 12:09
2003.06.26
Supreme2 открыл сайт.


4-84851
Керик
2003-04-25 20:49
2003.06.26
Перемещение столбцов