Главная страница
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.055 c
11-84047
z00100
2002-09-28 04:34
2003.06.26
недопущение запуска второй копии программы


4-84850
Airdriver
2003-04-26 12:34
2003.06.26
---|Ветка была без названия|---


14-84735
Дремучий
2003-06-05 18:54
2003.06.26
Кто из форумцев пользуется клиентом форума? Каким?


11-84055
SPeller
2002-10-10 14:37
2003.06.26
Динамическое создание/удаление контролов.


1-84403
adogg
2003-06-09 15:55
2003.06.26
StringGrid