Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/315.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 如何在系统托盘中显示进度_C#_Windows Phone 7_Windows Phone 8_Progress_System Tray - Fatal编程技术网

C# 如何在系统托盘中显示进度

C# 如何在系统托盘中显示进度,c#,windows-phone-7,windows-phone-8,progress,system-tray,C#,Windows Phone 7,Windows Phone 8,Progress,System Tray,我试图在系统托盘中显示进度。我用这个: ProgressIndicator pi = new ProgressIndicator(); SystemTray.ProgressIndicator = pi; SystemTray.ProgressIndicator.IsIndeterminate = false; 我遇到的问题是更改进度指示器的最大值。默认值似乎是一个,但我认为没有办法改变这一点。您将如何执行此操作?ProgressIndicator采用的是介于0和1之间

我试图在系统托盘中显示进度。我用这个:

    ProgressIndicator pi = new ProgressIndicator();
    SystemTray.ProgressIndicator = pi;
    SystemTray.ProgressIndicator.IsIndeterminate = false;

我遇到的问题是更改进度指示器的最大值。默认值似乎是一个,但我认为没有办法改变这一点。您将如何执行此操作?

ProgressIndicator采用的是介于
0
1
之间的
double

如果您想在其中输入任何其他数字(例如
0
100
),您需要做的是
将值标准化,这将使它们进入范围
0-1

例如,你会做:

double progress = 0.0;
double max = 100.0;

progress = 0.0/max;  // = 0.0
pi.Value = progress;

progress = 50.0/max; // = 0.5
pi.Value = progress;

progress = 100.0/max; // = 1.0
pi.Value = progress;
然后输入介于
0和1之间的值

关于此功能