Technology Programming

How to Create a Message Box in Visual Basic

    • 1). Create a string variable to hold your message. The MsgBox() function displays text that you define regardless of the type of message. The following code creates a string with an alert for the user:
      Dim strMessage as String
      strMessage = "Are you sure you want to delete this object?"

    • 2). Create a title for the message box. When you receive a message box, the top title bar displays a title for the window. The string below is used to set a title for the window:
      Dim strTitle as String
      strTitle = "Application Confirmation"

    • 3). Set a style for the message box. Styles include a "Yes/No" confirmation box, a box that just displays an "Ok" button or a box that gives the user the ability to abort an action. For this example, the code below sets the style for a "Yes/No" message box.
      Dim style as MsgBoxStyle
      style = MsgBoxStyle.YesNo

    • 4). Display the message box for the user. Combining all the options created in the previous steps, you can now display the message box and retrieve the user's answer. The code below displays the message box:
      Dim response as Integer
      response = MsgBox(strMessage, style, strTitle)

Related posts "Technology : Programming"

Brochure Design And Its Budget

Programming

Website designing delhi-web design services India-Website Development Company India

Programming

The Secrets and techniques Rob Fore Won't Tell you!

Programming

Where Do You Get Podcasting Ideas?

Programming

Avoid Hacking With The Help of WordPress Development Company

Programming

Sirius Radio - All You At Any Time Wished to Know

Programming

How to Use a Check Box to Filter a List

Programming

Get professional help from website development Dublin- promote business growth

Programming

PHP Shopping Carts

Programming

Leave a Comment