Здравствуйте, Господа ! возникла такая необходимость
procedure Form1_Button1_OnClick (Sender: TObject; var Cancel: boolean);
var
Edit: TdbEdit;
Panel:TPanel;
sLabel:TLabel;
Button,Button2:Tbutton;
begin
Panel:=TPanel.create(Form1);
Panel.Parent := Form1;
Panel.Width := 330;
Panel.height := 26;
Panel.BevelWidth := 0;
Panel.Left := 8;
Panel.Top := Form1.Tag + 44;
Form1.Tag := Form1.Tag + 34;
sLabel := TLabel.Create(Form1);
sLabel.Parent := Panel;
sLabel.Left := 10;
sLabel.Top := 7;
sLabel.Caption := 'Please,сlick new caption';
sLabel.OnClick:=@sLabelNew;
Edit := TdbEdit.Create(Form1);
Edit.Parent := Panel;
Edit.Left := 170;
Edit.Top := 3;
Button := Tbutton.Create(Form1);
Button.Parent := Panel;
Button.Left := 320;
Button.Width := 4;
Button.Top := 1;
Button.Caption:=':';
Button.OnClick:=@movePanel;
Button2 := Tbutton.Create(Form1);
Button2.Parent := Panel;
Button2.Left := 300;
Button2.Width := 20;
Button2.Top := 1;
Button2.Caption:='x';
Button2.OnClick:= @DeletePanel;
end;
procedure sLabelNew(sender: string);
begin
TLabel(Sender).caption:=InputBox('Caption','New caption','Please, new caption');
end;
procedure DeletePanel(sender: string);
begin
end;
procedure movePanel(sender: string);
begin
end;
Мне нужно найти панель на которой кликается кнопка Button2 и закрыть её...
помогите пожалуйста!