How to Create a Multi-Line Message in Vb.Net

Written by alexander gokhfeld
  • Share
  • Tweet
  • Share
  • Pin
  • Email
How to Create a Multi-Line Message in Vb.Net
VB.NET allows users to place multiline messages in the user forms. (Photodisc/Photodisc/Getty Images)

Microsoft VB.NET programming controls allow you to enter text in the user applications. The TextBox control usually displays or accepts an input of a single line of text. By using the Multiline and ScrollBars properties of the TextBox control, you can display or enter multiple lines of text or application messages on the VB.NET forms. You need to enable the AcceptsTab and AcceptsReturn properties to do vertical scrolling of the messages in a multiline TextBox control.

Skill level:

Other People Are Reading


  1. 1

    Click "Start" in Windows and then click "Microsoft Visual Studio."

  2. 2

    Click "File," select "Open" and then double-click on the Visual Basic program in which you want to create a multiline message in the text box control.

  3. 3

    Enter the following code after the "Public Sub ()" to add the "TextBox multi-line text example" message to the "Form1" TextBox control:

    Imports System

    Imports System.Collections.Generic

    Imports System.ComponentModel

    Imports System.Data

    Imports System.Text

    Imports System.Windows.Forms

    Public Class Form1

    Inherits Form
    Dim textBox1 As TextBox
    Public Sub New()
    End Sub
    Private Sub InitializeComponent()
        Me.textBox1 = New System.Windows.Forms.TextBox()
        ' textBox1
        Me.textBox1.AcceptsReturn = True
        Me.textBox1.AcceptsTab = True
        Me.textBox1.Dock = System.Windows.Forms.DockStyle.Fill
        Me.textBox1.Multiline = True
        Me.textBox1.ScrollBars =


        ' Form1
        Me.ClientSize = New System.Drawing.Size(312, 480)
        Me.Text = "TextBox multi-line message example"
    End Sub

    End Class

  4. 4

    Click "File" and then click "Save" to apply the change to the TextBox control in your VB.NET application.

Don't Miss

  • All types
  • Articles
  • Slideshows
  • Videos
  • Most relevant
  • Most popular
  • Most recent

No articles available

No slideshows available

No videos available

By using the site, you consent to the use of cookies. For more information, please see our Cookie policy.