Главная страница
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.016 c
3-83956
McSimm2
2003-06-04 08:16
2003.06.26
Оптимизация работы программы


3-83965
Berezne
2003-05-29 10:43
2003.06.26
Вопрос по DBComboBox


1-84177
Эдик Дятлов
2003-06-11 08:45
2003.06.26
Отрисовка окна в цикле


3-83881
Nick-From
2003-06-02 17:06
2003.06.26
Народ, в MySql индекс по первичным ключам сам создается


3-84036
elena_m
2003-05-29 17:50
2003.06.26
ADO connection, D7, MS SQL2000