我注意到WPF Progress Bar和WinForms Progress Bar完全填充所需的时间有所不同.
完全填写,如在Form和WPF中将Value设置为100,可以注意到WinForms平滑地填充了条形,而WPF立即填充它.
我想知道是否有可以在模板中编辑的属性来更改它.
希望我说清楚,如果有人想要,我也可以发布视频.
编辑
编辑2
用计时器填充进度条?
using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media.Animation;
namespace WpfApplication2
{
public partial class MainWindow : Window
{
public MainWindow()
{
this.InitializeComponent();
this.Title = "WPF Progress Bar Demo";
}
private void fill(int from, int to)
{
Duration duration = new Duration(TimeSpan.FromSeconds(0.5));
DoubleAnimation doubleanimation = new DoubleAnimation(from, to, duration);
progb.BeginAnimation(ProgressBar.ValueProperty, doubleanimation);
}
private void fill_Click(object sender, RoutedEventArgs e)
{
fill(0, 100);
}
}
}
Run Code Online (Sandbox Code Playgroud)
这样可以,它会在任何地方工作吗?
随意改变它. …
我正在创建一个剪贴板监视器作为项目,并在剪贴板上更改应用程序通过调用GetClipboardOwner来检测哪个程序使用了剪贴板.
这是代码的摘录:
protected override void WndProc(ref Message m)
{
const int WM_DRAWCLIPBOARD = 0x308;
const int WM_CHANGECBCHAIN = 0x030D;
switch (m.Msg)
{
case WM_DRAWCLIPBOARD:
Debug.Indent();
//Process the clipboard here
uint processId;
IntPtr ownerHwnd = GetClipboardOwner();
GetWindowThreadProcessId(ownerHwnd, out processId);
Process proc = Process.GetProcessById((int)processId);
Debug.WriteLine(String.Format("Window Title: {0} Filename: {1}", proc.MainWindowTitle, process.MainModule.FileName));
SendMessage(_NextClipboardViewer, m.Msg, m.WParam, m.LParam);
break;
case WM_CHANGECBCHAIN:
if (m.WParam == _NextClipboardViewer)
_NextClipboardViewer = m.LParam;
else
SendMessage(_NextClipboardViewer, m.Msg, m.WParam, m.LParam);
break;
default:
base.WndProc(ref m);
break;
}
}
Run Code Online (Sandbox Code Playgroud)
和DLLImports:
[DllImport("User32.dll")]
public static extern …Run Code Online (Sandbox Code Playgroud) 如何使用Metro UI开发应用程序,以便它们可以在Windows XP/Vista/7上运行?
应用程序的一个示例是MetroBackUp.
我在Windows 7上安装了Visual Studio 2010和11 Beta.
是否必须在Windows 8 CP中开发它们?他们会在其他操作系统中工作吗
.net windows visual-studio-2010 microsoft-metro windows-runtime