Is there a non-blocking version of MessageBox.Show (or something like it)?

后端 未结 4 1961
自闭症患者
自闭症患者 2021-01-01 09:22

Long-delayed update

I\'m accepting MUG4N\'s answer to this question, and I also want to respond to some of the criticisms that were raised against it.

ChrisF

相关标签:
4条回答
  • 2021-01-01 09:51

    What I would try is call the MessageBox function from the Win32 API directly, like :

    using System.Runtime.InteropServices;
    
    [DllImport("User32.dll")]
    public static extern int MessageBox(int h, string m, string c, int type);
    

    Try using a null handle, and the APPLMODAL type. That may work.

    0 讨论(0)
  • 2021-01-01 09:53

    What about adding a NotifyIcon to your application and displaying a balloon tip? The down side is that the notification will disappear after a short time, but maybe that's best for your users if they don't need to take action.

    There are more suggestions on this question.

    0 讨论(0)
  • It's an old question, but nevertheles...

    1) Import IWshShell ('Windows Script Host Object Model')

    Dim wsh As New IWshRuntimeLibrary.WshShell wsh.Popup(String.Concat(Me.GetType.FullName, vbCrLf, _ Application.ExecutablePath), 0.75, "Title", MessageBoxButtons.OKCancel Or MessageBoxIcon.Question)

    Jens...

    0 讨论(0)
  • 2021-01-01 10:10

    You need to use multi threading to perform this task in which one thread (the main thread) will do the processing and the other thread will be used to show the messagebox.

    0 讨论(0)
提交回复
热议问题