I got some code here, which creates a label just fine, but when I free the label it STILL shows on the form. Even though it's been removed and no longer 'assigned'.
Here is the code below. It creates the label fine, but wont remove. No exceptions, and the assigned says false.
I can reproduce this with a TRectangle as well.
type
TForm1 = class(TForm)
Button1: TButton;
Button2: TButton;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
Lab : TLabel;
end;
var
Form1: TForm1;
implementation
{$R *.fmx}
procedure TForm1.Button1Click(Sender: TObject);
begin
Lab := TLabel.Create(Self);
Lab.Parent := Form1;
Lab.Text := 'Hello!';
Lab.Position.X := 30;
Lab.Position.Y := 40;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
FreeAndNil(Lab);
ShowMessage(BoolToStr(Assigned(Lab), true));
end;
JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)