状态栏进度条
www.dimcax.com
状态栏进度条
记得论坛上以前讨论过状态栏进度条,进度不为1的问题一直没有解决。前几天偶然看了一下kean的博客……
using system.runtime.interopservices;
using system.windows.forms;
using autodesk.autocad.runtime;
namespace progressmetertest
{
public class cmds
{
[dllimport("acad.exe", charset = charset.auto,
entrypoint = "?acedsetstatusbarprogressmeter@@yahpb_whh@z")]
private static extern int acedsetstatusbarprogressmeter(string label, int minpos, int maxpos);
[dllimport("acad.exe", charset = charset.auto,
entrypoint = "?acedsetstatusbarprogressmeterpos@@yahh@z")]
private static extern int acedsetstatusbarprogressmeterpos(int pos);
[dllimport("acad.exe", charset = charset.auto, entrypoint = "?acedrestorestatusbar@@yaxxz")]
private static extern int acedrestorestatusbar();
[commandmethod("test")]
public void progressbar()
{
acedsetstatusbarprogressmeter("进度条...", 0, 100);
for (int i = 0; i <= 100; i++)
{
for (int j = 0; j <= 50; j++) // 把50这个数字调小,可加快速度
{
system.threading.thread.sleep(1);
acedsetstatusbarprogressmeterpos(i);
application.doevents();
}
}
acedrestorestatusbar();
}
}
}
复制代码
[
(7.41 kb)
下载次数:2
高