private void Button1_Click(object sender, EventArgs e) { Fruits_textbox.Visible = true; Fruits_textbox.ReadOnly = true; Fruits_textbox.Clear(); string filename = "fruit.txt"; if (File.Exists(filename)) { StreamReader stream; try { using (stream = new StreamReader(filename)) { Fruits_textbox.AppendText(stream.ReadToEnd()); } } catch (IOException) { MessageBox.Show("Error Reading from file", "error file", MessageBoxButtons.OK, MessageBoxIcon.Error); } } else { MessageBox.Show(filename + " does not exit", "file error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }