本文演示C#计时器:Stopwatch的使用。
页面代码:
<Window x:Class="TestStopwatch.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Height="265" Width="380">
<Grid>
<Button Content="开始" Height="23" HorizontalAlignment="Left" Margin="22,80,0,0" Name="btn_Start" VerticalAlignment="Top" Width="75" Click="btn_Start_Click" />
<Label Content="计时时间:" Height="28" HorizontalAlignment="Left" Margin="22,25,0,0" Name="label1" VerticalAlignment="Top" />
<Button Content="停止" Height="23" HorizontalAlignme