BagZ
BagZ

Reputation: 11

Adding a new line Richtextbox

Can anyone correct me on what is wrong with this code? I can't add a new line inside Richtextbox control

Dim sb = New System.Text.StringBuilder()
        sb.Append("{\rtf1\ansi")
        sb.Append("\b " & TextBox2.Text & "\b0" & Environment.NewLine & "my body")
        sb.Append("}")
        Textbox.Rtf = sb.ToString

Upvotes: 0

Views: 374

Answers (1)

LarsTech
LarsTech

Reputation: 81675

Because you aren't using rtf codes. Try:

sb.Append("\b " & TextBox2.Text & "\b0\par my body")

Upvotes: 1

Related Questions