Bonjour,
On peut faire une MsgBox avec fermeture temporisée comme ceci:
Mettre un bouton et un Timer
Option Strict On
Public Class Form1
'http://stackoverflow.com/questions/11255118/vb-net-close-window-by-title
Private Declare Auto Function FindWindowEx Lib "user32" (ByVal parentHandle As Integer, _
ByVal childAfter As Integer, _
ByVal lclassName As String, _
ByVal windowTitle As String) As Integer
Private Declare Auto Function PostMessage Lib "user32" (ByVal hwnd As Integer, _
ByVal message As UInteger, _
ByVal wParam As Integer, _
ByVal lParam As Integer) As Boolean
Dim WM_QUIT As UInteger = &H12
Dim WM_CLOSE As UInteger = &H10
Dim titre As String
Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
Timer1.Interval = 3000 '3 secondes
Timer1.Enabled = True
titre = "Message Box Temporisée"
MessageBox.Show("Durée de l'information : 3 secondes", titre, MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
Timer1.Enabled = False
End Sub
Private Sub Timer1_Tick(sender As System.Object, e As System.EventArgs) Handles Timer1.Tick
Dim handle As Integer = FindWindowEx(0, 0, Nothing, titre)
PostMessage(handle, WM_CLOSE, 0, 0)
End Sub
End Class