标题: 新手学习C#下的TIMER控件,为何不能运行?。 [打印本页] 作者: cqwgj_123 时间: 2020-4-27 23:24 标题: 新手学习C#下的TIMER控件,为何不能运行?。 using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Timers;
namespace WpfApplication1
{
/// <summary>
/// MainWindow.xaml 的交互逻辑
/// </summary>
///
public partial class MainWindow : Window
{
Timer t1 = new Timer();
public MainWindow()
{
InitializeComponent();
t1.Interval = 1000;
t1.Enabled = true;
}