winform messagebox自动关闭

2020-05-09 17:09:22 浏览数 (3)

自动关闭的messagebox

代码语言:javascript复制
Form msg = new Form();
Task.Run(new Action(() =>
{
    Thread.Sleep(4000);
    Invoke(new Action(() =>
    {
        msg.Close();
    }));
}));
MessageBox.Show(msg,ex.Message);

0 人点赞