Learning to use MsgBox in Visual Basic 2015

Asked By 10 points N/A Posted on -
qa-featured

Hello!

I want to learn how to use message box in VB 2015. What is the use of prompt? What is the proper way to use title? Can you show me example and how to implement it? Please explain it to me also? What is xpos and ypos arguments? What is the use of helpfile and context arguments in a message box? Can you tell me what are the controls I need to use in creating a program with MsgBox? What are the properties I need to set? How is it implemented? Thank you!

SHARE
Answered By 0 points N/A #175186

Learning to use MsgBox in Visual Basic 2015

qa-featured

Hello Angela!

Prompt is used to state the message to be shown in the dialog box.

Example: strname = InputBox(“Enter your name here: “, “by: JOHN HART”,”TechyV.com”)

Xpos and Ypos is used to distinguish the horizontal and the vertical position of the dialog box to be positioned in the monitor. Help file and context are used to provide context-sensitive help for the dialog box. To create a simple program that will illustrate and make use of input box or message box, just open a project in VB, just add a form, double click the form and you just need to type to follow the code below.

Public Class Form1

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

        Dim name As String

        name = InputBox("Enter your name here:", "by: JOHN HART", "TechyV.com")

        MsgBox("Hello " + name + ", welcome to TechyV.com!")

    End Sub

End Class

Related Questions