Inserting text from SyntaxEditor in to a Stream object

SyntaxEditor for Windows Forms Forum

Posted 18 years ago by Jean Versailles
Avatar
i have a TextBox with let say 200-500 lines of text in the text property, but i need to put these text in to a Stream object. So the question is how would i do that. can any one help out?

any sample would be greate.

Thank You,
jen0s.

Comments (5)

Posted 18 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Jean,

Just create a StreamWriter on the Stream and use its Write method to write the SyntaxEditor.Document.Text.


Actipro Software Support

Posted 18 years ago by Jean Versailles
Avatar
do you have any example?
Posted 18 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
new StreamWriter(stream).Write(editor.Document.Text);
Then you close the stream if you are done with it.


Actipro Software Support

Posted 18 years ago by Jean Versailles
Avatar
I tried that, but it doesn't work for some reason.
i want to put the SyntaxEditor.Document.Text into a Stream then Deserialize it.


jen0s
Posted 18 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
It will work fine... that is the code to do it. The only other thing might be that you may need to call Flush after the Write call in case the text is being buffered.


Actipro Software Support

The latest build of this product (v24.1.0) was released 2 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.