基本的に、ある間隔、つまり5秒を適用するときは、それを待つ必要があります。
インターバルを適用してすぐにタイマーを実行し、5秒待たないことは可能ですか?(私はインターバル時間を意味します)。
どんな手掛かり?
ありがとう!!
public partial class MainWindow : Window
{
DispatcherTimer timer = new DispatcherTimer();
public MainWindow()
{
InitializeComponent();
timer.Tick += new EventHandler(timer_Tick);
this.Loaded += new RoutedEventHandler(MainWindow_Loaded);
}
void timer_Tick(object sender, EventArgs e)
{
MessageBox.Show("!!!");
}
void MainWindow_Loaded(object sender, RoutedEventArgs e)
{
timer.Interval = new TimeSpan(0, 0, 5);
timer.Start();
}
}