hi friends
i am trying to add a help button to my program. i have added a button like this
private void button9_Click(object sender, EventArgs e)
{
System.IO.FileInfo finfo = new System.IO.FileInfo("Help.txt");
finfo.Attributes = System.IO.FileAttributes.ReadOnly;
System.Diagnostics.Process.Start("Help.txt");
}
but here i am getting problem that text file is opening but if we edit any thing that file is updating.
here i need only in the form of readonly please give me an idea for this problem.

1 answers
I don't think that approach will work because AFAIK it's not possible to open Notepad (which will be the default text editor on most machines) in read-only mode.
What you could do instead is to add a form to your project (HelpForm say) and cover it with a TextBox (textBox1 say) whose properties are set in the Properties Box as follows:
BackColor - Info
ForeColor - InfoText
MultiLine - True
ReadOnly - true
ScrollBars - Both
You could also use a RichTextBox instead and/or add a Close Button if you don't want the user to have to rely on the 'X' button.
Then in your HelpButton click eventhandler, add the following code:
answered one year ago by:
17279