小编Blu*_*lue的帖子

Tulpep PopupNotifier无法使用Timer

using System;
using System.Data.SQLite;
using System.Drawing;
using System.Timers;
using System.Windows.Forms;
using Tulpep.NotificationWindow;   

public partial class Form1 : Form
{
    System.Timers.Timer timer = null;

    public Form1()
    {
        InitializeComponent();
    }

    private void buttonStart_Click(object sender, EventArgs e)
    {
        if (timer == null)
        {
            timer = new System.Timers.Timer();
            timer.Elapsed += new System.Timers.ElapsedEventHandler(ObjTimer_Elapsed);
            timer.Interval = 10000;
            timer.Start();
        }
    }

    private void ObjTimer_Elapsed(object sender, ElapsedEventArgs e)
    {
        try
        {
            PopupNotifier pop = new PopupNotifier();
            pop.TitleText = "Test";
            pop.ContentText = "Hello World";
            pop.Popup();

          //MessageBox.Show("");      !!!  here is …
Run Code Online (Sandbox Code Playgroud)

c# notifications timer winforms

2
推荐指数
1
解决办法
2200
查看次数

标签 统计

c# ×1

notifications ×1

timer ×1

winforms ×1