代码之家  ›  专栏  ›  技术社区  ›  The Archetypal Paul

如何在Windows Mobile 6上获得“忙碌的轮子”?

  •  3
  • The Archetypal Paul  · 技术社区  · 16 年前

    当事情发生时,WindowsMobile会弹出一个“忙碌的轮子”——一个旋转的彩色磁盘。我在文档中找不到这是怎么做到的-有人能给我指出正确的方向吗?

    在这种情况下,我们需要提示用户说我们在做一段时间的事情,但我们不知道要花多长时间。所以我们不能做进度条,所以建议使用这个繁忙的轮子。

    4 回复  |  直到 16 年前
        1
  •  5
  •   ctacke    16 年前

    使用 SetCursor / LoadCursor / ShowCursor API,如下所示:

    SetCursor(LoadCursor(NULL, IDC_WAIT));
    
    // my code
    
    ShowCursor(FALSE);
    
        2
  •  4
  •   Martin Liesén    16 年前

    使用CompactFramework。

    旋轮:

    system.windows.forms.cursor.current=system.windows.forms.cursors.waitcursor;

    恢复正常:

    system.windows.forms.cursor.current=system.windows.forms.cursors.default;

        3
  •  2
  •   SmacL    16 年前

    我只是在猜测,但我可以想象 CWaitCursor . 基本上,您只需在堆栈上创建一个,它就会出现,并且当它在超出作用域时被破坏时就会被分解,例如。

    void DoSomethingSlow()
    {
      CWaitCursor cw;
    .
    .
    .
    .
    }
    
        4
  •  0
  •   Mat Nadrofsky    16 年前

    来自: http://mobiledeveloper.wordpress.com/2006/07/05/wait-cursor/

    查看cursor.current=cursors.waitcursor;

    try {
     Cursor.Current = Cursors.WaitCursor;
     //Do something time consuming…
    }
    finally {
     Cursor.Current = Cursors.Default;
    }