Tớ tạo một richtextbox và thực hiện chức năng lưu trữ khi click vào button như sau:
Code:
private void button1_Click(object sender, EventArgs e)
{
saveToolStripMenuItem.Enabled = true;
saveFileDialog1.Title = "SendFile";
saveFileDialog1.DefaultExt = "*.doc";
saveFileDialog1.OverwritePrompt = true;
if (saveFileDialog1.ShowDialog() == DialogResult.OK)
{
richTextBox1.SaveFile(saveFileDialog1.FileName);
}
}
Bây giờ tớ muốn sau khi click vào button (SendFile) thì sau 1 khoảng thời gian mặc định nào đó nó tự lưu. Bạn tớ nói dùng Timer, nhưng tớ chưa biết làm nó. Vậy mình phải thực hiện như thế nào với Timer?