The statement to open an input box is:
<var>=InputBox(<prompt>,<title>,<default>,<Xpos>,<Ypos>,<HelpFile>,<Context>)
Compare this syntax to the code to display the input box shown below.
Private Sub BtnHello_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) _
Handles BtnHello.Click
Dim User As String
User = InputBox("What is your name?", "Greetings")
Me.Text = "Hello " & User
End Sub 'BtnHello_Click
Of course, the user could still ignore the button, you could put the code to display the input box in form load!
A message box is similar to an input box. The message box can be used as either a function (returns an answer) or a statement (no answer returned) The programmer can select the type of message box to display. The type indicates which command buttons to display: Yes, No, OK, Cancel, Abort, Retry, etc.
There are two formats for opening a message box: as a statement or as a function that returns an answer.
The format for the statement is:
msgBox <prompt>,type,<Title>
This method is usually used when the only button on the message box is OK. We do not need to find out which button they pressed, they’re going to press OK!