C# 如何在Aero/.NET4中获取块样式进度条
我有三种风格的进度条。“块”和“连续”现在渲染相同,而我记得用于渲染为块的块 这是.NET4、Aero Glass或Windows7独有的吗?如何告诉我的应用程序使用经典块?使用此选项C# 如何在Aero/.NET4中获取块样式进度条,c#,winforms,user-interface,coding-style,progress-bar,C#,Winforms,User Interface,Coding Style,Progress Bar,我有三种风格的进度条。“块”和“连续”现在渲染相同,而我记得用于渲染为块的块 这是.NET4、Aero Glass或Windows7独有的吗?如何告诉我的应用程序使用经典块?使用此选项 public class ContinuousProgressBar : ProgressBar { public ContinuousProgressBar() { this.Style = ProgressBarStyle.Continuous; }
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);
}