如何在 Windows Mobile 6 上获取"busy wheel"?

How do I get a "busy wheel" on Windows Mobile 6?

本文关键字:获取 busy wheel Windows Mobile      更新时间:2023-10-16

当事情发生时,Windows Mobile会弹出一个"忙碌的轮子"——一个旋转的彩色磁盘。我在文档中找不到这是如何做到的——有人能给我指明正确的方向吗?

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

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

SetCursor(LoadCursor(NULL, IDC_WAIT));
// my code
ShowCursor(FALSE);

使用compactframework。

转轮:

System.Windows.Forms.Cursor.Current=System.Windows.Fforms.Cursors.WaitCursor;

恢复正常:

System.Windows.Forms.Cursor.Current=System.Windows.Fforms.Cursors.Default;

我只是猜测这里,但我想它是CWaitCursor。基本上,你只需在堆栈上创建一个,它就会出现,当它超出范围时被破坏时就会消失,例如

void DoSomethingSlow()
{
  CWaitCursor cw;
.
.
.
.
}

来源: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;
}