Click here to Skip to main content
15,881,089 members
Articles / Programming Languages / Visual Basic

Improved RichTextBox - IRTB

Rate me:
Please Sign up or sign in to vote.
4.73/5 (18 votes)
3 Apr 2013CPOL17 min read 71.6K   3.7K   47  
This article describes a simple way to implement Line Numbering, HighLight Line and show current Line and Column
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class IRTB
    Inherits System.Windows.Forms.UserControl

    'UserControl overrides dispose to clean up the component list.
    <System.Diagnostics.DebuggerNonUserCode()> _
    Protected Overrides Sub Dispose(ByVal disposing As Boolean)
        Try
            If disposing AndAlso components IsNot Nothing Then
                components.Dispose()
            End If
        Finally
            MyBase.Dispose(disposing)
        End Try
    End Sub

    'Required by the Windows Form Designer
    Private components As System.ComponentModel.IContainer

    'NOTE: The following procedure is required by the Windows Form Designer
    'It can be modified using the Windows Form Designer.  
    'Do not modify it using the code editor.
    <System.Diagnostics.DebuggerStepThrough()> _
    Private Sub InitializeComponent()
        Me.IRTBTextContainer = New System.Windows.Forms.RichTextBox()
        Me.TableLayoutPanel1 = New System.Windows.Forms.TableLayoutPanel()
        Me.PBNumbering = New System.Windows.Forms.PictureBox()
        Me.TableLayoutPanel1.SuspendLayout()
        CType(Me.PBNumbering, System.ComponentModel.ISupportInitialize).BeginInit()
        Me.SuspendLayout()
        '
        'IRTBTextContainer
        '
        Me.IRTBTextContainer.Dock = System.Windows.Forms.DockStyle.Fill
        Me.IRTBTextContainer.Location = New System.Drawing.Point(63, 3)
        Me.IRTBTextContainer.Name = "IRTBTextContainer"
        Me.IRTBTextContainer.Size = New System.Drawing.Size(230, 304)
        Me.IRTBTextContainer.TabIndex = 0
        Me.IRTBTextContainer.Text = ""
        Me.IRTBTextContainer.WordWrap = False
        '
        'TableLayoutPanel1
        '
        Me.TableLayoutPanel1.ColumnCount = 2
        Me.TableLayoutPanel1.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 60.0!))
        Me.TableLayoutPanel1.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100.0!))
        Me.TableLayoutPanel1.Controls.Add(Me.PBNumbering, 0, 0)
        Me.TableLayoutPanel1.Controls.Add(Me.IRTBTextContainer, 1, 0)
        Me.TableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill
        Me.TableLayoutPanel1.Location = New System.Drawing.Point(0, 0)
        Me.TableLayoutPanel1.Name = "TableLayoutPanel1"
        Me.TableLayoutPanel1.RowCount = 1
        Me.TableLayoutPanel1.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100.0!))
        Me.TableLayoutPanel1.Size = New System.Drawing.Size(296, 310)
        Me.TableLayoutPanel1.TabIndex = 1
        '
        'PBNumbering
        '
        Me.PBNumbering.Dock = System.Windows.Forms.DockStyle.Fill
        Me.PBNumbering.Location = New System.Drawing.Point(3, 3)
        Me.PBNumbering.Name = "PBNumbering"
        Me.PBNumbering.Size = New System.Drawing.Size(54, 304)
        Me.PBNumbering.TabIndex = 1
        Me.PBNumbering.TabStop = False
        '
        'IRTB
        '
        Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
        Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
        Me.Controls.Add(Me.TableLayoutPanel1)
        Me.Name = "IRTB"
        Me.Size = New System.Drawing.Size(296, 310)
        Me.TableLayoutPanel1.ResumeLayout(False)
        CType(Me.PBNumbering, System.ComponentModel.ISupportInitialize).EndInit()
        Me.ResumeLayout(False)

    End Sub
    Friend WithEvents IRTBTextContainer As System.Windows.Forms.RichTextBox
    Friend WithEvents TableLayoutPanel1 As System.Windows.Forms.TableLayoutPanel
    Friend WithEvents PBNumbering As System.Windows.Forms.PictureBox

End Class

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Sweden Sweden
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions