Taskbar Progress 工作列 進度條 C# .NET
No Comments

更新於 2017-03-14 14:08:38

如上圖所示,工作列可以有進度條。本方法需要較底層,所以必須調用外部API。

請先下載參考:WindowsAPICodePack

載點一:
https://sites.google.com/site/1456wbff/home/WindowsAPI.7z?attredirects=0&d=1
載點二:
https://mega.nz/#!0J9BSbYB!4svqcg8liM6fRGDc9Zk-D_NjNzdMF5GEHY6vzLt13rY
載點三:
http://cht.tw/h/nrkw9

下載完畢後匯入參考,並使用代碼:

public void set_status_taskbar ( int value_, int max_ ) {
    if ( Microsoft.WindowsAPICodePack.Taskbar.TaskbarManager.IsPlatformSupported ) {
        var taskbarInstance = Microsoft.WindowsAPICodePack.Taskbar.TaskbarManager.Instance;
		taskbarInstance.SetProgressState(Microsoft.WindowsAPICodePack.Taskbar.TaskbarProgressBarState.Normal);
        taskbarInstance.SetProgressValue(value_, max_);
    }
}

public void set_status_finish () {
    if ( Microsoft.WindowsAPICodePack.Taskbar.TaskbarManager.IsPlatformSupported ) {
        var taskbarInstance = Microsoft.WindowsAPICodePack.Taskbar.TaskbarManager.Instance;
        taskbarInstance.SetProgressState(Microsoft.WindowsAPICodePack.Taskbar.TaskbarProgressBarState.NoProgress);
    }
}

僅此作為筆記。


This entry was posted in C#, General, Experience, Note By Weil Jimmer.

About Weil Jimmer

Hi! Everyone! My name is Weil Jimmer. This is my personal blog. I'm a webmaster of this site. I hope the site will be popular. Now, Let's go! Enjoy gaining more knowledge.
More Details About Me : https://weils.net/profile.php


Leave a message.

Only the first 10 comment will show.