Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

how to save text file as their custom setting

$
0
0
hy guy's .... i have a programm as i discuss before like a notepad and iwan that when i save a text file and i set the font-size like =28 or something like that, now when anytime i open it again it will open with the same setting as i set,,, the problem is that it's not.

here is the save button code i have..


 private void saveToolStripMenuItem_Click(object sender, EventArgs e)
        {
            string fnane = "";
            saveFileDialog1.FileName = "";
            saveFileDialog1.Filter = "Textfiles|*.txt|All files|*.*";
            foreach (Control rhh in tabControl1.SelectedTab.Controls)
            {
                if (rhh is RichTextBox)
                {
                    if (saveFileDialog1.ShowDialog()!= DialogResult.Cancel)
                    {

                        fnane = saveFileDialog1.FileName;
                        (rhh as RichTextBox).SaveFile(fnane, RichTextBoxStreamType.PlainText);

                    }
                }
            }


Viewing all articles
Browse latest Browse all 51036

Trending Articles