CodeItBetter Programming Another VB Programming Blog

How to add a New Line to Existing Text Box Text Programmatically

Posted on January 5, 2009
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
'Controls - How to add a New Line to Existing Text Box Text Programmatically

Option Explicit
 
Private Sub Command1_Click()
    Dim NewText As String
    With Text1
        NewText = "My New Text"
        .SelStart = Len(.Text)
        .SelText = vbNewLine & NewText
    End With
End Sub
 
Private Sub Form_Load()
    Text1.Text = "My Initial Text"
End Sub
Filed under: Controls Leave a comment
Comments (0) Trackbacks (0)

No comments yet.


Leave a comment


 

No trackbacks yet.