Window popup at specific time in WPF?

How to create and show a popup at a specific time in WPF? I mean, how to display a window on the side of the taskbar.

+2
source share
3 answers

You can use the timer if you are trying to make this popup in a certain number of hours / seconds / minutes (or determine how many hours / seconds / minutes are left until your specific time arrives).

private System.Windows.Threading.DispatcherTimer popupTimer;

// Whatever is going to start the timer - I've used a click event
private void OnClick(object sender, RoutedEventArgs e)
{
    popupTimer = new System.Windows.Threading.DispatcherTimer();

    // Work out interval as time you want to popup - current time
    popupTimer.Interval = specificTime - DateTime.Now;
    popupTimer.IsEnabled = true;
    popupTimer.Tick += new EventHandler(popupTimer_Tick);
}

void popupTimer_Tick(object sender, EventArgs e)
{
    popupTimer.IsEnabled = false;
    // Show popup
    // ......
}

Okay, so you also want to know how to make popups like notifier, which maybe this article in CodeProject can help.

+4
source

.

0

You might want to check DispatcherTimer.

0
source

All Articles