如何在Aero/.NET 4中获取Block Style Progressbars

tsi*_*ilb 5 c# user-interface coding-style winforms progress-bar

我有三种风格的三个ProgressBars.块和连续现在呈现相同,而我记得用于呈现为块的块.

http://www.kconnolly.net/pics/pb.jpg

这是.NET 4,Aero Glass或Windows 7的独特之处吗?如何告诉我的应用程序使用经典的块?

Nav*_*ani 1

用这个

public class ContinuousProgressBar : ProgressBar 
{ 
    public ContinuousProgressBar() 
    { 
        this.Style = ProgressBarStyle.Continuous; 
    }
    protected override void CreateHandle()
    {
        base.CreateHandle();
        try
        {
            SetWindowTheme(this.Handle, "", "");
        }
        catch 
        { 
        }
    }

    [System.Runtime.InteropServices.DllImport("uxtheme.dll")]  
    private static extern int SetWindowTheme(IntPtr hwnd, string appname, string idlist);
}
Run Code Online (Sandbox Code Playgroud)