nbsp; }
else if (myResult == DialogResult.No)
{
e.Cancel = false;
}
else if(myResult == DialogResult.Cancel)
{
e.Cancel = true;
}
}
}
}
子窗体:FrmFont
namespace Notepad
{
public partial class FrmFont : Form
{
private NotepadFont _myFont;
public FrmFont(NotepadFont myFont)
{
InitializeComponent();
_myFont = myFont;
}
private void FrmFont_Load(object sender, EventArgs e) [Page]
{
InitFont();
InitFontStyle();
InitFontSize();
this.AcceptButton = btnCancel;
}
初始化字体#region 初始化字体
public void InitFont()
{
FontFamily family = FontFamily.Families;
txtFont.Text = family.Name.ToString();
foreach (FontFamily f in family)
{