Главная страница
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
1-84317
dfg
2003-06-15 12:03
2003.06.26
Как правильно отследить ошибку?


1-84288
Ilg
2003-06-14 18:12
2003.06.26
Допустимость имени файла


1-84104
Zemal
2003-06-10 11:30
2003.06.26
Как определить объём занимаемой приложением памяти?


1-84229
Ghost
2003-06-13 08:48
2003.06.26
Функция для удаления из Listbox2 строк которые есть в Listbox1


14-84764
Rafik
2003-06-03 16:05
2003.06.26
Честное слово!!!