bsp; if (txtFontStyle.Text == \"Bold\")
{
return FontStyle.Bold;
}
else if (txtFontStyle.Text == \"Italic\") [Page]
{
return FontStyle.Italic;
}
else if (txtFontStyle.Text == \"Regular\")
{
return FontStyle.Regular;
}
return 0;
}
#endregion
private void lstFont_Click(object sender, EventArgs e)
{
txtFont.Text = lstFont.SelectedItem.ToString();
_myFont.SetFont(txtFont.Text, float.Parse(txtFontSize.Text),GetFontStyle(txtFontStyle.Text));
}
private void FrmFont_FormClosing(object sender, FormClosingEventArgs e)
{
}
}
}
用于传值的委托类:
namespace Notepad
{
public delegate void DelegateFont(string fontFamily, float fontSize, FontStyle fontStyle);
public class NotepadFont
{
public event DelegateFont Font;
private string fontFamily;
public string FontFamily
{
get { return fontFamily