Click here to Skip to main content
15,668,167 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
suppose line typed in richtextbox is as below:


but when the file is saved.the saved files shows output as below:

so,can i get some help for resolving my issue?

What I have tried:

SaveFileDialog1.Filter = "TXT Files (*.txt*)|*.txt|All Files(*.*)|*.*"

If SaveFileDialog1.ShowDialog = Windows.Forms.DialogResult.OK Then

My.Computer.FileSystem.WriteAllText(SaveFileDialog1.FileName, RichTextBox1.Text, True)

MsgBox("File Saved as : " + SaveFileDialog1.FileName)
End If
Updated 11-Jun-19 23:46pm

1 solution

Share this answer
shaileshshinde 12-Jun-19 7:37am    
means? i am not able to understand.

can i get the code?
Richard MacCutchan 12-Jun-19 7:56am    
There is no code. The RichTextBox separates lines only by the newline character, which simple editors (e.g. Notepad) do not recognise. You should use the Lines property to get the text as described in the documentation.
shaileshshinde 17-Jun-19 6:36am    
Issue has been resolved by myself .Thanks all for help

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

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900