Главная страница
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.044 c
14-84525
Fly`
2003-06-06 16:58
2003.06.26
Нужен текстовый редактор


3-84006
abc
2003-05-30 16:05
2003.06.26
как вернуть TQuery в нормальный режим, после режима Edit??


1-84107
Yanis
2003-06-10 14:57
2003.06.26
Как узнать какой кнопкой мыши был сделан клик?


11-84059
Vit@l
2002-09-28 20:13
2003.06.26
Глюки в KOL


1-84365
Scorpx
2003-06-16 21:10
2003.06.26
Программное присвоение события.