定时器应用
1.引入:using System.Windows.Threading; // 定时器命名空间
2.初始化对象:DispatcherTimer moveTimer1 = new DispatcherTimer();
3.添加定时器事件:moveTimer1.Tick += MoveTimer1_Tick;
4.设置定时器频率:(以毫秒数):moveTimer1.Interval = TimeSpan.FromMilliseconds(100);
设置颜色
对象.Background=Brushes.颜色;
BG.Background = Brushes.Red;
对象.Background = new LinearGradientBrush(); // 设置成线性渐变
BG.Background = new LinearGradientBrush(Colors.Yellow, Colors.Pink, 10);
对象.Background = new RadialGradientBrush();// 设置成径线渐变
BG.Background = new RadialGradientBrush(Colors.Red,Colors.Orange);
对象.Background = new SolidColorBrush(); // 纯色
BG.Background = new SolidColorBrush(Color.FromRgb(80,00,80));
后续持续更新