Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 2 of 2 total
Thread ShowModal problem
Fri, Aug 28 2015 12:13 PMPermanent Link

Uli Becker

I'm just upgrading my "Cinedisk" project to the latest Build.

This code doesn't work any more:

procedure TMainForm.btnSettingsClick(Sender: TObject);
begin
   if not FormExists(DlgUserForm) then
      DlgUserForm := TDlgUserForm.create(self);
   DlgUserForm.Left := self.Left + self.Width - DlgUserForm.Width - 25;
   DlgUserForm.Top := self.Top + btnSettings.Top + 12;
   DlgUserForm.ShowModal; <---------------- Error
end;

The ErrorMessage says: "You cannot call ShowModal for the embedded form
DlgUserForm".

What does that mean?

Thanks Uli
Fri, Aug 28 2015 2:50 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Uli,

<< This code doesn't work any more:

procedure TMainForm.btnSettingsClick(Sender: TObject);
begin
   if not FormExists(DlgUserForm) then
      DlgUserForm := TDlgUserForm.create(self);
   DlgUserForm.Left := self.Left + self.Width - DlgUserForm.Width - 25;
   DlgUserForm.Top := self.Top + btnSettings.Top + 12;
   DlgUserForm.ShowModal; <---------------- Error
end; >>

Use this instead:

procedure TMainForm.btnSettingsClick(Sender: TObject);
begin
   if not FormExists(DlgUserForm) then
      DlgUserForm := TDlgUserForm.create(Application);
...

I forgot to add this as a breaking change. I'll update the release notes to reflect this.

Tim Young
Elevate Software
www.elevatesoft.com
Image