hi friend,
how to add new line char after each 50 char in rich text box?
can anyone help to my issue....
Thanks & Regards,
priya.
Loading
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend4days leftRegister
Hirendra SisodiyaRank #258 · 9.8K reputationPosted Mar 16, 2010, 2:51 AM EDT
you can apply this code in text changed event of rich textbox like as :
Private Sub RichTextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RichTextBox1.TextChanged
If RichTextBox1.Text.Length Mod 50 = 0 Then
RichTextBox1.AppendText(Environment.NewLine)
End If
End Sub
thanks
please check as answere if you like this answere
Amit ChoudharyRank #145 · 15.8K reputationPosted Mar 16, 2010, 3:19 AM EDT
OntextChanged event of your rich text box write following code:
Please mark the answer if it helps you.
Sam5 reputationPosted Mar 30, 2010, 11:17 PM EDT
Sam HobbsRank #107 · 20.5K reputationPosted Mar 31, 2010, 7:53 AM EDT
Use of symbolic names such as Environment.NewLine is good programming, but the CrLf combination is very standard.