How to animate a control roll out in Inno Setup
我想为我的安装程序中的控件滚动设置动画。
您可以观看此视频。
您可以使用计时器来为控件设置动画。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | [Code] function SetTimer(hWnd: longword; nIDEvent, uElapse: LongWord; lpTimerFunc: LongWord): LongWord; external '[email protected] stdcall'; function KillTimer(hWnd, nIDEvent: LongWord): LongWord; external '[email protected] stdcall'; var MainPanelAnimated: Boolean; AnimationTimer: LongWord; procedure AnimationTimerProc( H: LongWord; Msg: LongWord; IdEvent: LongWord; Time: LongWord); var L: Integer; begin L := WizardForm.MainPanel.Left + ScaleX(5); if L > 0 then begin L := 0; KillTimer(0, AnimationTimer); end; WizardForm.MainPanel.Left := L; end; procedure CurPageChanged(CurPageID: Integer); begin if WizardForm.OuterNotebook.ActivePage = WizardForm.InnerPage then begin if not MainPanelAnimated then begin AnimationTimer := SetTimer(0, 0, 5, CreateCallback(@AnimationTimerProc)); WizardForm.MainPanel.Left := -WizardForm.MainPanel.Width; MainPanelAnimated := True; end; end; end; |
对于
(动画实际上比图片显示的更流畅)
对于从右到左的动画,请参阅 Inno 设置 - 在确定的页面中动画控制从右滚出。