I making a small office word like program. I have four things. A menu bar containing File>Open,Save,Exit. I want to create a short cut for open, save. Could someone help me how to do that. this is my code
namespace Texteditor
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void saveToolStripMenuItem_Click(object sender, EventArgs e)
{
SaveFileDialog saveFile = new SaveFileDialog();
DialogResult result = saveFile.ShowDialog();
if (result == DialogResult.Cancel)
return;
string strFilename = saveFile.FileName;
System.IO.StreamWriter sw = System.IO.File.CreateText(strFilename);
sw.Write(textBox1.Text);
sw.Close();
}
private void openToolStripMenuItem_Click(object sender, EventArgs e)
{
OpenFileDialog fileChooser = new OpenFileDialog();
DialogResult result = fileChooser.ShowDialog();
if (result == DialogResult.Cancel)
return;
string strFilename = fileChooser.FileName;
}
private void textBox1_TextChanged(object sender, EventArgs e)
{
}