I had msg box in my Vb program like this
MsgBox("Record inserted successfully")
how to autoclick the ok button from code is there any way to do that in Visual Basic... i am very new to Visual Basic please help me
I had msg box in my Vb program like this
MsgBox("Record inserted successfully")
how to autoclick the ok button from code is there any way to do that in Visual Basic... i am very new to Visual Basic please help me
You could do this by obtaining the MessageBox's hWnd and then sending it a message to simulate the Ok click. However, this is very complicated relative to the desired outcome, if it's even possible that way.
I would suggest creating your own form that mimics the messagebox and expose a public method that will allow you to control it.
There is a very long way to do that. You have to call a lot of APIs etc... I recommend you to create a dialog form having a label with text "Record inserted successfully" and a button with text "OK". By doing this you will have easier control over it.
You can show the dialog like this:
Dim newdialog As New Dialog1
Me.ShowDialog(newdialog)
And simulate the button press, which means closing the dialog:
newdialog.Close()