using System; using System.Windows.Forms; using System.IO; class ex : Form { TextBox tb1 = new TextBox(); ex() { Text = "hello"; tb1.Dock = DockStyle.Fill; tb1.Multiline = true; Controls.Add(tb1); MenuStrip ms = new MenuStrip(); Controls.Add(ms); ToolStripMenuItem File = new ToolStripMenuItem("File"); ms.Items.Add(File); ToolStripMenuItem mi = new ToolStripMenuItem("Open"); mi.Click += new EventHandler(Open_Click); File.DropDownItems.Add(mi); } void Open_Click(object sender, EventArgs e) { tb1.Text = File.ReadAllText(@"C:\test\test1.txt"); } static public void Main() { Application.Run(new ex()); } }