Notes to your code:
1)
You want to show/hide forms between main form and other forms. Please, read this:
How to: Display Modal and Modeless Windows Forms[
^]
How to: Choose the Startup Form in Windows Application[
^]
How to: Change the Startup Object for an Application[
^]
How to: Make a Startup Windows Form Invisible[
^]
2)
If you use long string as a variable, please use
StringBuilderClass[
^] to build this long string.
Using StringBuilder Class[
^] is simplest than do that:
public string CNF = "S -> NP VP" + System.Environment.NewLine +
"NP -> DT NN | QT NN | NP PP | NP RC | n | p" + System.Environment.NewLine +
"DT -> d" + System.Environment.NewLine +
"NN -> JJ NN | n" + System.Environment.NewLine +
"JJ -> JJ JJ | j" + System.Environment.NewLine +
"QT -> q" + System.Environment.NewLine +
"PP -> PT NP | GG PP" + System.Environment.NewLine +
"PT -> i" + System.Environment.NewLine +
"GG -> g" + System.Environment.NewLine +
"RC -> WH NP | WH VP" + System.Environment.NewLine +
"WH -> w" + System.Environment.NewLine;
You can simply
Append[
^] text an
d than use ToString() method.
StringBuilder MyStringBuilder = new StringBuilder("Hello Kitty!");
MyStringBuilder.Append(" What a beautiful day.");
MyStringBuilder.Append(" What a wonderful world.");
MyStringBuilder.Append(" What a beautiful women.");
string s = MyStringBuilder.ToString();
3)
If you want to pass data between forms, please see these:
Passing Data between Windows Forms[
^]
Using a delegate to pass data between two forms[
^]
There is a lot of examples on this site. Please use "Search" box on the right-top corner. ;)