dimanche 10 mai 2015

Duplicate Messagebox in Timer.Tick Function

I am looking for a way to (tell / check) if a (error / warning) MessageBox is still open on another run of a function. an example of what i am asking is:

Imports System.Windows.Forms
Class MainWindow
    Dim t As Timer = New Timer

    Public Sub load() Handles Me.Loaded
         t.Interval = 60000

         AddHandler t.Tick, AddressOf tick

         t.Start()
    End Sub

    Public Sub tick()
         ' if message is not open
         MessageBox.Show("Example Error Message", "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error)
         ' end if 
    End Sub
End Class

when the tick event is triggered the if statement checks if the window is open, if it isn't then it shows the message, if it is it does noting

Aucun commentaire:

Enregistrer un commentaire