Hi to all,
Iam implementing a notepad application.When i seleceted from Format->font menu the fonts are applied to the existing text in the textbox.After applying i saved the application.But the selected fonts from the Font menu are not applied to the text
I used the following code for saving
streamwriter sw = new StreamWriter(--filename);
sw.Write(textBox1.Text);
sw.Close();
Please help me.
Thanks in advance.

notepad
DrBytes
picflight
vinaypugalia
Hi,
In the open file dialog written this code to load the file
richTextBox1.LoadFile(openFileDialog1.FileName);
It is giving an exception ,File format is not valid.
in save dialog i used .txt as default extension.
The above load file() will load the .rtf or ASCII text files.but why it is giving the above exception.
Please help me.
Thanks in advance.
MUSIC56522
Hi,
I placed the rich text box,and fonts are applied to the richtext box.
Now to save the changes to a file i used the following statement
richTextBox1.SelectionFont = new Font(fontname, fontsize, fstyle);
richTextBox1.SaveFile(fn, RichTextBoxStreamType.RichText);
where fn contains th filename.
but now also the changes are not applied to the file.
Please help me.
LSanders
Hi
thank you very much for your valuble information.
Mansour K.
Landale