仔细测试一下,你会发现在执行耗时任务时,动画常常是静止不动的。为了能够正常播放动画,这里我采用了多线程技术来实现。
//... ...
m_busyform.show();
m_busyform.refresh();
threadstart threaddelegate = new threadstart(loaddata);
thread newthread = new thread(threaddelegate);
newthread.start();
//... ...
private void loaddata()
{
//
//执行你的耗时操作
//