假设我要取消选中组件3-5:
procedure CurPageChanged(CurPageID: Integer);
var i: integer;
begin
if CurPageID = wpSelectComponents then
{ 0 based index }
for i:= 2 to 4 do begin
WizardForm.ComponentsList.Checked[i] := False;
end;
end;
工作正常,已将其禁用,但窗口底部所需的总尺寸仍显示所有组件的值。有办法更新吗?
修改:尝试替换
WizardForm.ComponentsList.Checked[i] := False;
与
WizardForm.ComponentsList.CheckItem(i, coUncheck);
但是它没有任何改变。
答案 0 :(得分:1)
终于找到了! Support Classes Reference页面显示TWizardForm.ComponentsList
具有属性OnClickCheck
,这似乎是指向未公开的TWizardForm.ComponentsListClickCheck
过程的指针。我只想添加一行:
WizardForm.ComponentsList.OnClickCheck(nil);
完整示例:
procedure CurPageChanged(CurPageID: Integer);
var i: integer;
begin
if CurPageID = wpSelectComponents then begin
{ 0 based index }
for i:= 2 to 4 do begin
WizardForm.ComponentsList.CheckItem(i, coUncheck);
end;
WizardForm.ComponentsList.OnClickCheck(nil);
end;
end;