Greetings. The following is probably a very newbie question, which is appropriate because that's what I am! I'm finishing up creating a word processing application and need to know how to link my text help file with the "help" menu click event. When the user clicks help, I want him to see this text file. I don't know if it was the right thing to do, but I already did the following: In Visual C# 2008 Express, I clicked on "project", and then "new item" and created a helpfiletext.txt file. I wrote the text file and saved it so now it is a part of my project. How do I now associate this file with the help menu click event. or have I already screwed the whole process up beyond redemption? THANKS.
Bob C.
Loading
Sam HobbsPosted Mar 14, 2010, 8:27 PM
There is a different way to create a text file that you want to be a read-only part of the program. First open the Properties node for your project in the Solution Explorer, then double-click on Resources.resx. Note that Microsoft will try to confuse you; there is another node in the project for "Resources" but you want to use the Resources.resx under the Properties node. It will probabluy work to use the other "Resources" node but for now do not. Once the Resources.resx opens, look at the top-left for "Add Resource". Click on the down-arrow and select "Add New Text File". Put your help text there. After you have copied the help text, you can remove the other text file from the project.
Create another form for the help text. Put just a textbox in the form and set the form for multiple lines. In the form construtor or the form load event, use something such as:
textBox1 = Properties.Resources.TextFile1;
Then with the form in design view, add a handler for the HelpRequested event and use the following in the event:
Form2 f = new Form2();
f.Show();
Of course, some of the names will require changing.
The text file will be built into the application, so you don't need to copy it separately from the program when you copy it to another system or whatever. After you have all that working, sometime in the future, you might want to created a formatted help file. I am not sure what format would work best; either HTML or RTF.
Eventually you will want to learn how to use the Windows help system, which I think is HTML Help but I am not sure. There are three versions of help systems that Windows has used and I am not sure which one is now the "standard".
Bob CongdonPosted Mar 15, 2010, 3:52 PM
Bob C.