Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 2 of 2 total
Thread Form not displayed after first time
Sun, Jun 3 2018 5:10 AMPermanent Link

Huseyin Aliz

myBiss ApS

Avatar

Hi All,

I have a issue with a form (form3) not being displayed after first time
it's called by form.show. First time it's called from form1 or form2 it
works, next time it does not display when called from either forms.

// Form 1 calling form 3:

procedure Tform1.Button1Click(Sender: TObject);
begin
if not assigned(Form3) then Form3:=TForm3.Create(Menuform.mainpanel);
try
Form3.Dataset1.Params.Clear;
Form3.Dataset1.Params.Add('Customer='+QuotedStr(Mainform.Login.columns['Customer'].asString));
Database.Loadrows(Form3.Dataset1);
finally
Form3.FromForm1 := True;
Form3.FromForm2 := False;
Form3.Show;
end;
end;

// Form 2 calling form 3:

procedure TForm2.Button1Click(Sender: TObject);
begin
if not assigned(Form3) then Form3:=TForm3.Create(Menuform.mainpanel);
try
Form3.Dataset1.Params.Clear;
Form3.Dataset1.Params.Add('Customer='+QuotedStr(Mainform.Login.columns['Customer'].asString));
Database.Loadrows(Form3.Dataset1);
finally
Form3.FromForm1 := False;
Form3.FromForm2 := True;
Form3.Show;
end;
end;

// Hiding form 3:

procedure TForm3.Button1Click(Sender: TObject);
begin
// Some data manipulation with Dataset1 here..
Form3.hide;
end;

Form3 has no "oncreate" or "onshow" events that have effect on
showing/hiding forms/components.
Also to mention that this works with 2.04, and the issue started with
2.06 (using latest build).

Thanks in advance.

Regards,
Hüseyin

Mon, Jun 4 2018 3:40 AMPermanent Link

Huseyin Aliz

myBiss ApS

Avatar

Hi All,

Form3.Show;
Form3.BringtoFront;

BringtoFront seems to be my solution.

Regards,
Hüseyin

Den 03-06-2018 kl. 11:10 skrev Hüseyin Aliz:
> Hi All,
>
> I have a issue with a form (form3) not being displayed after first
> time it's called by form.show. First time it's called from form1 or
> form2 it works, next time it does not display when called from either
> forms.
>
> // Form 1 calling form 3:
>
> procedure Tform1.Button1Click(Sender: TObject);
> begin
> if not assigned(Form3) then Form3:=TForm3.Create(Menuform.mainpanel);
> try
> Form3.Dataset1.Params.Clear;
> Form3.Dataset1.Params.Add('Customer='+QuotedStr(Mainform.Login.columns['Customer'].asString));
>
> Database.Loadrows(Form3.Dataset1);
> finally
> Form3.FromForm1 := True;
> Form3.FromForm2 := False;
> Form3.Show;
> end;
> end;
>
> // Form 2 calling form 3:
>
> procedure TForm2.Button1Click(Sender: TObject);
> begin
> if not assigned(Form3) then Form3:=TForm3.Create(Menuform.mainpanel);
> try
> Form3.Dataset1.Params.Clear;
> Form3.Dataset1.Params.Add('Customer='+QuotedStr(Mainform.Login.columns['Customer'].asString));
>
> Database.Loadrows(Form3.Dataset1);
> finally
> Form3.FromForm1 := False;
> Form3.FromForm2 := True;
> Form3.Show;
> end;
> end;
>
> // Hiding form 3:
>
> procedure TForm3.Button1Click(Sender: TObject);
> begin
> // Some data manipulation with Dataset1 here..
> Form3.hide;
> end;
>
> Form3 has no "oncreate" or "onshow" events that have effect on
> showing/hiding forms/components.
> Also to mention that this works with 2.04, and the issue started with
> 2.06 (using latest build).
>
> Thanks in advance.
>
> Regards,
> Hüseyin
>
>
Image