ont();
myFont.Font += new DelegateFont(SetTxtContentFont); //订阅事件
FrmFont frmFont = new FrmFont(myFont);
frmFont.ShowDialog();
SetTxtContentFont(myFont.FontFamily,myFont.FontSize,myFont.NFontStyle);
}
private void SetTxtContentFont(string fontFmaily,float fontSize,FontStyle fontStyle)
{
txtContent.Font = new Font(fontFmaily, fontSize, fontStyle);
}
private void FrmNotePad_FormClosing(object sender, FormClosingEventArgs e)
{
e.Cancel = true;
DialogResult myResult = MessageBox.Show(\"是否保存文档\", \"系统消息\", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question);
if (myResult == DialogResult.Yes)
{
saveDialog.Filter = \"文本文件(*.txt)|*.txt|所有文件|*.*\";
saveDialog.FileName = \"*.txt\";
DialogResult myResult2 = saveDialog.ShowDialog(); [Page]
if (myResult2 == DialogResult.OK)
{
e.Cancel = false;
}
else
{
e.Cancel = true;
}
&