德尔福JVCL - JvWizard,运行时添加页面

发布于 2024-08-03 22:41:02 字数 439 浏览 2 评论 0原文

我需要在运行时向 TJvWizard 添加一个页面(该页面可能是由插件注册的)。我尝试将其添加到 JvWizard.Pages,但它似乎不是有效的方法 - 我需要将该页面作为倒数第二页插入...

我尝试了代码

AddWizardPage(APage: TJvWizardCustomPage);
begin
if APage <> nil then
  begin
    Apage.Wizard:=JvWizard1;
    JvWizard1.Pages.Insert(JvWizard1.Pages.Count - 1 , APage);
    JvWizardRouteMapNodes1.Invalidate;
  end;
end;

,但它被添加为 RouteMap 上的最后一页,并且是在启动时显示,因为它是第一个...

提前感谢!

I need to add a page to TJvWizard at runtime (the page might be registered by plugin). I tried adding it to JvWizard.Pages, but it doesn't seem to be valid way - I need to insert the page as the penultimate page...

I tried the code

AddWizardPage(APage: TJvWizardCustomPage);
begin
if APage <> nil then
  begin
    Apage.Wizard:=JvWizard1;
    JvWizard1.Pages.Insert(JvWizard1.Pages.Count - 1 , APage);
    JvWizardRouteMapNodes1.Invalidate;
  end;
end;

but it is added as the last page on RouteMap, and is displayed at startup as it was first one ...

thanks in advance!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

风吹短裙飘 2024-08-10 22:41:02

您必须将 Page.Wizard 属性设置为 Wizard 组件,而不是调用 Pages.Insert。这将设置父级并插入页面。

procedure TForm1.FormCreate(Sender: TObject);
var
  Page: TJvWizardCustomPage;
begin
  Page := TJvWizardWelcomePage.Create(Self);
  Page.Wizard := JvWizard1;

  JvWizard1.ActivePage := Page;
end;

Instead of calling Pages.Insert you must set the Page.Wizard property to the Wizard component. This will set the parent and inserts the page.

procedure TForm1.FormCreate(Sender: TObject);
var
  Page: TJvWizardCustomPage;
begin
  Page := TJvWizardWelcomePage.Create(Self);
  Page.Wizard := JvWizard1;

  JvWizard1.ActivePage := Page;
end;
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文