Форум: "Основная";
Текущий архив: 2002.04.29;
Скачать: [xml.tar.bz2];
ВнизДобавление-удаление фреймов Найти похожие ветки
← →
Катерина (2002-04-15 11:03) [0]Удивительное дело: создаю фреймы, затем по нажитию определенной кнопки добавляю один из них список компонент. По окончании работы, удаляю из компонентов:
var
Form1: TForm1;
theFrame1 : TFrame1;
theFrame2 : TFrame2;
implementation
{$R *.dfm}
procedure TForm1.FormShow(Sender: TObject);
begin
ShowMessage(IntToStr(ComponentCount));
theFrame1 := TFrame1.Create(Owner);
theFrame2 := TFrame2.Create(Owner);
ShowMessage(IntToStr(ComponentCount));
end;
procedure CloseAll;
var aComp : TComponent;
begin with Form1 do
begin
ShowMessage(IntToStr(ComponentCount));
aComp := FindComponent("Frame1");
if aComp <> NIL then RemoveComponent(aComp);
aComp := FindComponent("Frame2");
if aComp <> NIL then RemoveComponent(aComp);
Update;
ShowMessage(IntToStr(ComponentCount));
end;
procedure Browse1;
begin with Form1 do
begin
CloseAll;
theFrame1.Parent := Self;
theFrame1.Top := 20;
theFrame1.Left := 8;
theFrame1.Width := 841;
theFrame1.Height := 558;
theFrame1.Visible := TRUE;
InsertComponent(theFrame1);
end;
end;
procedure Browse2;
begin with Form1 do
begin
CloseAll;
theFrame2.Parent := aSelf;
theFrame2.Top := 20;
theFrame2.Left := 8;
theFrame2.Width := 841;
theFrame2.Height := 558;
theFrame2.Visible := TRUE;
InsertComponent(theFrame2);
end;
end;
Отладочная печать честно фиксирует кол-во компонентов формы. Но фрейм после удаления остается на форме. Что делать? Заранее спасибо.
Страницы: 1 вся ветка
Форум: "Основная";
Текущий архив: 2002.04.29;
Скачать: [xml.tar.bz2];
Память: 0.44 MB
Время: 0.006 c