论坛风格切换切换到宽版
  • 3286阅读
  • 3回复

请教老虎版主关于 Can't cast an object 问题? [复制链接]

上一主题 下一主题
离线546242502
 

发帖
332
金钱
-3060
威望
-306
只看楼主 正序阅读 0 发表于: 2015-08-16



代码:
  1. [Setup]
  2. AppName=DriveVolume
  3. AppVerName=DriveVolume
  4. Uninstallable=false
  5. UpdateUninstallLogAppName=false
  6. DisableDirPage=true
  7. DisableProgramGroupPage=true
  8. DefaultDirName={pf}\DriveVolume
  9. DisableStartupPrompt=true
  10. [Code]
  11. procedure SetControlCursor(control: TWinControl; cursor: TCursor);
  12. var i:Integer;
  13. wc: TWinControl;
  14. begin
  15.   if (not (control = nil)) then begin
  16.     control.Cursor := cursor;
  17.     try
  18.       for i:=0 to control.ControlCount-1 do begin
  19.         wc := TWinControl(control.Controls[i]);
  20.         if (NOT(wc = nil)) then
  21.           SetControlCursor(wc, cursor)
  22.         else
  23.           control.Controls[i].Cursor := cursor;
  24.       end; {for}
  25.     finally
  26.     end;{try}
  27.   end;{if}
  28. end;{procedure SetControlCursor}
  29. procedure InitializeWizard ();
  30. begin
  31. SetControlCursor(WizardForm, crHourGlass);
  32. end;


离线546242502

发帖
332
金钱
-3060
威望
-306
只看该作者 3 发表于: 2015-08-17
回 2楼(gnatix) 的帖子
gnatix:但是看不出意义何在,为什么要把鼠标光标改成一样。 (2015-08-16 23:53) 

谢谢老虎版主解答;
其实找个换成个性化光标的脚本示例,但是只找到这个代码,又存在问题,所以拿来请教了
离线gnatix

发帖
7696
金钱
-8279
威望
-828
只看该作者 2 发表于: 2015-08-16
但是看不出意义何在,为什么要把鼠标光标改成一样。
离线gnatix

发帖
7696
金钱
-8279
威望
-828
只看该作者 1 发表于: 2015-08-16
[Code]
procedure SetControlCursor(control: TWinControl; cursor: TCursor);
var n: Integer;
wc: TWinControl;
begin
  if (not (control = nil)) then begin
    control.Cursor := cursor;
    try
      for n:=0 to control.ControlCount-1 do
      begin
       if control.Controls[n] is TWinControl then
         begin
         wc := TWinControl(control.Controls[n]);
         if (NOT(wc = nil)) then
           SetControlCursor(wc, cursor)
         else
           control.Controls[n].Cursor := cursor;
         end;
      end; {for}
    finally
    end;{try}
  end;{if}
end;{procedure SetControlCursor}

procedure InitializeWizard;
begin
  SetControlCursor(WizardForm, crHourGlass);
end;