반응형
private void 새파일ToolStripMenuItem_Click(object sender, EventArgs e)
{
cForm child = new cForm();
child.MdiParent = this;
child.Text = "새파일"+n;
n++;
child.Show();
}
private void 저장ToolStripMenuItem_Click(object sender, EventArgs e)
{
////////////////////////////////////////////////////////////
RichTextBox child = (RichTextBox)ActiveMdiChild.ActiveControl;
////////////////////////////////////////////////////////////
if(saveFileDialog1.ShowDialog() ==DialogResult.OK)
{
StreamWriter writer = new StreamWriter(saveFileDialog1.FileName);
MessageBox.Show(saveFileDialog1.FileName);
writer.Write(child.Text);
writer.Close();
}
}
private void 닫기ToolStripMenuItem_Click(object sender, EventArgs e)
{
Form child =ActiveMdiChild;
if (child != null)
{
child.Close();
}
}
'.NET > C# Form' 카테고리의 다른 글
닷넷 응용프로그램 보안 관련 (0) | 2009.12.02 |
---|---|
C# 자식창에서 부모창으로 값 넘기기 (0) | 2008.12.01 |
C# 아이콘 고정 아이콘최대화버튼 false (0) | 2008.11.25 |
C# 아이콘 추가 (0) | 2008.11.25 |
C# 메세지 박스(MessageBox) (0) | 2008.10.23 |
C# 메모장 만들기 (0) | 2008.10.23 |
C# DateTimePicker 컨트롤 MonthCalender (0) | 2008.10.23 |
C# 툴바와 상태바, NotifyIcon 컨트롤 (0) | 2008.10.23 |