我创建了一个向导,允许用户从单选按钮的选择中进行选择,但是当选择大于对话框大小时,我遇到问题,它不会显示其余的选择,如下图所示:
我希望使用向下滚动栏,但很难在网上找到教程。有人可以帮忙吗?
for code := 0 to 9 do
begin
CheckBox := TNewCheckListBox.Create(Page);
CheckBox.Parent := Page.Surface;
CheckBox.AddCheckBox('test', '', 0, True, False, False, True, nil);
CheckBox.AddRadioButton('1', '', 1, True, True, nil );
CheckBox.AddRadioButton('2', '', 1, False,True, nil );
end
最佳答案
为所有复选框和单选按钮创建一个大的TNewCheckListBox
,而不是为每组创建一个单独的框。如果内容不适合,TNewCheckListBox
将自动显示滚动条。
function CustomPage(var Page:TWizardPage;PageId:Integer):Integer;
var
CheckListBox: TNewCheckListBox;
begin
Page:=CreateCustomPage(PageId,ExpandConstant('AAA'),ExpandConstant('BBB'));
CheckListBox:=TNewCheckListBox.Create(Page);
with CheckListBox do begin
Parent:=Page.Surface;
Left:=ScaleX(0);
Top:=ScaleY(50);
Width:=ScaleX(413);
Height:=ScaleY(153);
AddCheckBox(ExpandConstant('Test'),'',0,False,True,False,True,Nil);
AddRadioButton(ExpandConstant('1'),'',1,True,True,Nil);
AddRadioButton(ExpandConstant('2'),'',1,False,True,Nil);
AddCheckBox(ExpandConstant('Test'),'',0,False,True,False,True,Nil);
AddRadioButton(ExpandConstant('1'),'',1,True,True,Nil);
AddRadioButton(ExpandConstant('2'),'',1,False,True,Nil);
AddCheckBox(ExpandConstant('Test'),'',0,False,True,False,True,Nil);
AddRadioButton(ExpandConstant('1'),'',1,True,True,Nil);
AddRadioButton(ExpandConstant('2'),'',1,False,True,Nil);
AddCheckBox(ExpandConstant('Test'),'',0,False,True,False,True,Nil);
AddRadioButton(ExpandConstant('1'),'',1,True,True,Nil);
AddRadioButton(ExpandConstant('2'),'',1,False,True,Nil);
end;
Result:=Page.ID;
end;
procedure InitializeWizard();
var
NewPage: TWizardPage;
NewPageID:Integer;
begin
NewPageID:=CustomPage(NewPage,wpWelcome);
end;
示例2:
function CustomPage(var Page:TWizardPage;PageId:Integer):Integer;
var
CheckBox: TNewCheckListBox;
I:Integer;
begin
Page:=CreateCustomPage(PageId,ExpandConstant('AAA'),ExpandConstant('BBB'));
CheckBox:=TNewCheckListBox.Create(Page);
with CheckBox do begin
Parent:=Page.Surface;
Left := ScaleX(0);
Top := ScaleY(56);
Width := ScaleX(413);
Height := ScaleY(153);
for I:=0 to 9 do begin
AddCheckBox('test', '', 0, True, False, False, True, nil);
AddRadioButton('1', '', 1, True, True, nil );
AddRadioButton('2', '', 1, False,True, nil );
end;
end;
end;
关于inno-setup - 如何在 Inno Setup 中创建可滚动的单选按钮列表?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32432543/