Installation 为什么';是否在Inno设置中选中了自定义页面上的单选按钮?

Installation 为什么';是否在Inno设置中选中了自定义页面上的单选按钮?,installation,inno-setup,pascalscript,Installation,Inno Setup,Pascalscript,即使我将其中一个按钮的checked属性设置为True,为什么不选中rbStandardInstallType和rbCustomInstallType单选按钮?另一方面,rbDefaultMSSQLInstance和rbNamedMSSQLInstance单选按钮会被选中 我创建如下单选按钮: 函数CreateRadioButton( AParent:TNewNotebookPage;AChecked:Boolean;AWidth,ALeft,top,AFontSize:Integer; AFo

即使我将其中一个按钮的
checked
属性设置为
True
,为什么不选中
rbStandardInstallType
rbCustomInstallType
单选按钮?另一方面,
rbDefaultMSSQLInstance
rbNamedMSSQLInstance
单选按钮会被选中

我创建如下单选按钮:

函数CreateRadioButton(
AParent:TNewNotebookPage;AChecked:Boolean;AWidth,ALeft,top,AFontSize:Integer;
AFontStyle:TFontStyles;const acoption:String):TNewRadioButton;
开始
结果:=TNewRadioButton.Create(WizardForm);
结果呢
开始
父母:=公寓;
选中:=已选中;
宽度:=宽度;
左:=ALeft;
顶部:=顶部;
字体大小:=字体大小;
Font.Style:=AFontStyle;
标题:=一个选项;
结束;
结束;
我有两个自定义页面,我必须在左侧显示我的图像,在右侧显示一些文本和单选按钮(每页2个单选按钮)。 因此,在我的
InitializeWizard
过程中,我写了以下内容:

wpSelectInstallTypePage:=CreateCustomPage(wpSelectDir,'Caption','Description');
rbStandardInstallType:=CreateRadioButton(WizardForm.InnerPage,True,WizardForm.InnerPage.Width,ScaleX(15),WizardForm.MainPanel.Top+ScaleY(30),9,[fsBold],“标准”);
rbCustomInstallType:=CreateRadioButton(WizardForm.InnerPage,False,rbStandardInstallType.Width,rbStandardInstallType.Left,rbStandardInstallType.Top+rbStandardInstallType.Height+ScaleY(16),9,[fsBold],“自定义”);
wpmsqlinstalltypepage:=CreateCustomPage(wpSelectInstallTypePage.ID,'Caption2','Description2');
rbDefaultMSSQLInstance:=CreateRadioButton(WizardForm.InnerPage,True,WizardForm.InnerPage.Width,ScaleX(15),WizardForm.MainPanel.Top+ScaleY(30),9,[fsBold],“DefaultInstance”);
RBNameDMSqlInstance:=CreateRadioButton(WizardForm.InnerPage,False,rbDefaultMSSQLInstance.Width,rbDefaultMSSQLInstance.Left,rbDefaultMSSQLInstance.Top+rbDefaultMSSQLInstance.Height+ScaleY(10),9,[fsBold],'NamedInstance');
最后,这里是我的
CurPageChanged
代码,以便正确显示所有控件:

过程CurPageChanged(CurPageID:Integer);
开始
案例CurPageID
wpSelectInstallTypePage.ID,wpMSSQLInstallTypePage.ID:
WizardForm.InnerNotebook.Visible:=False;
其他的
WizardForm.InnerNotebook.Visible:=True;
结束;
RBDefaultMSSQLSInstance.Visible:=CurPageID=WPMSSQLSInstallTypePage.ID;
RBNameDMSqlInstance.Visible:=CurPageID=wpMSSQLInstallTypePage.ID;
rbStandardInstallType.Visible:=CurPageID=wpSelectInstallTypePage.ID;
rbCustomInstallType.Visible:=CurPageID=wpSelectInstallTypePage.ID;
结束

您将单选按钮添加到错误的父控件(
WizardForm.InnerPage
)。不适用于您正在创建的自定义页面。然后通过显式隐藏/显示
CurPageChanged
中的单选按钮来解决该缺陷

由于所有四个单选按钮都具有相同的父级(
WizardForm.InnerPage
),因此只能选中其中一个。因此,当您检查
rbDefaultMSSQLInstance
时,
rbStandardInstallType
被隐式取消选中


有关正确的代码,请参阅:

(确保删除多余的
CurPageChanged
code)



您还应该考虑使用手动替换单选按钮到一个通用的自定义页面。

< p>您将单选按钮添加到一个错误的父控件( WZARDFRADION.InEngulp)。不适用于您正在创建的自定义页面。然后通过显式隐藏/显示
CurPageChanged
中的单选按钮来解决该缺陷

由于所有四个单选按钮都具有相同的父级(
WizardForm.InnerPage
),因此只能选中其中一个。因此,当您检查
rbDefaultMSSQLInstance
时,
rbStandardInstallType
被隐式取消选中


有关正确的代码,请参阅:

(确保删除多余的
CurPageChanged
code)



你也应该考虑使用,而不是手动添加单选按钮到一个通用的自定义页面。

我根据这个例子编写我的代码:如果我使用<代码> CreateInputOptionPage < /代码>我怎么把我的图像放在左边?默认情况下,code>Left=0不是我需要的。这就是为什么我使用了
内页
。如果您在一开始就与您的问题共享了链接,那么这个问题会更有意义。无论如何,我看不出图像与这个单选按钮问题有什么关系。它可能应该转到另一个问题。尽管通常情况下,您可以保留图像的
CurPageChanged
hack,即使您使用单选按钮的
CreateInputOptionPage
。我已将屏幕截图添加到我的问题中。我不知道如何在不创建自定义页面的情况下使页面看起来像那样。另外,我在这些单选按钮下面添加了一些文本作为详细说明。通过
CreateInputOptionPage
创建的页面可以像通过
CreateCustomPage
创建的通用页面一样进行自定义。如果您需要详细信息,请提出新问题。我相信关于单选按钮的问题已经得到了回答。我是根据以下示例编写代码的:如果我使用
CreateInputOptionPage
我将如何将图像放置在最左边<默认情况下,code>Left=0不是我需要的。这就是为什么我使用了
内页
。如果您在一开始就与您的问题共享了链接,那么这个问题会更有意义。无论如何,我看不出图像与这个单选按钮问题有什么关系。它可能应该转到另一个问题。虽然一般来说,您可以对图像进行
CurPageChanged
hack操作,