I have been trying to display a file using SyntaxBox components (http://code.google.com/p/alsing/wiki/SyntaxBox). I dropped the SyntaxControlBox into a basic Windows form but I haven't figured out a way to get a file there. I created a button to use OpenFileDialog so I can find the file I need, but I haven't figured out how to take the contents of that file and display them into the SyntaxControlBox window. Here is the code I have:
private void syntaxBoxControl1_Click_1(object sender, EventArgs e) { SyntaxDocument MyDoc = new SyntaxDocument();
//SyntaxDocument Doc = MySyntaxBox.Document;
//OpenFileDialog x = new OpenFileDialog();
//x.ShowDialog();
//MyDoc.Text = "hello world";
//MyDoc.InsertText("Hellow World", 3, 12, true);
//MyDoc.ShowFind();
//StreamReader Test1 = new StreamReader(sender);
}
private void button1_Click(object sender, EventArgs e)
{
OpenFileDialog x = new OpenFileDialog();
x.ShowDialog();
}
I'm stuck how to do this. Do I pass something to syntaxBoxControl1_Click_1 or create something within that function instead of a separate button?