0
<Window x:Class="ASTHENIA.Loading"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="Loading" Height="300" Width="300">
<Grid>
    <ProgressBar  HorizontalAlignment="Left" Name="load"  Height="12" Margin="54,100,0,0" VerticalAlignment="Top" Width="205"/>

</Grid>

我设置了进度条,load.Maximum=100,min为0。如何让进度条在5分钟后加载完毕。

4

1 回答 1

1

像这样的东西应该工作:

<ProgressBar HorizontalAlignment="Left" Height="12" Margin="54,100,0,0" VerticalAlignment="Top" Width="205">
   <ProgressBar.Triggers>
      <EventTrigger RoutedEvent="Loaded">
         <BeginStoryboard>
            <Storyboard>
               <DoubleAnimation
                  Storyboard.TargetProperty="Value"
                  From="0" To="100" Duration="0:5:0" 
               />
            </Storyboard>
         </BeginStoryboard>
      </EventTrigger>
   </ProgressBar.Triggers>
</ProgressBar>

http://msdn.microsoft.com/en-us/library/ms752312.aspx

于 2013-06-13T14:08:56.390 回答