入门级示例,通过Timer控件实现类似进度条效果using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Threading.Tasks;using System.Windows.Forms;using System.Media;namespace _12_16_Timer控件_2_{ public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void timer1_Tick(object sender, EventArgs e) { label1.Text = label1.Text.Substring(1) label1.Text.Substring(0, 1); } private void timer2_Tick(object sender, EventArgs e) { label2.Text = DateTime.Now.ToString(); } private void button1_Click(object sender, EventArgs e) { //SoundPlayer mySP = new SoundPlayer(); //mySP.SoundLocation=@"E:\学习资料\学习资料\C#-资料\我要自学网C#\自学网C#项目\12-16 Timer控件(2)\12-16 Timer控件(2)\2019-09-03__15-45-25__4473905.wav"; //mySP.Play(); } }}
评论