public Font ShowDialog(Font SelectedFont) { var fontDialog = new XtraFontDialog(SelectedFont); if (fontDialog.ShowDialog() == DialogResult.OK) { SelectedFont = fontDialog.ResultFont; } fontDialog.Dispose(); return(SelectedFont); }
void ShowFontDialog() { if (CurrentRichTextBox == null) { return; } Font dialogFont = null; if (SelectFont != null) { dialogFont = (Font)SelectFont.Clone(); } else { dialogFont = CurrentRichTextBox.Font; } XtraFontDialog dlg = new XtraFontDialog(dialogFont); if (dlg.ShowDialog() == DialogResult.OK) { CurrentRichTextBox.SelectionFont = dlg.ResultFont; beiFontSize.EditValue = dlg.ResultFont.Size; } }
void ShowFontDialog() { if (rtbData == null) return; Font dialogFont = null; if (SelectFont != null) dialogFont = (Font)SelectFont.Clone(); else dialogFont = rtbData.Font; XtraFontDialog dlg = new XtraFontDialog(dialogFont); if (dlg.ShowDialog() == DialogResult.OK) { rtbData.SelectionFont = dlg.ResultFont; beiFontSize.EditValue = dlg.ResultFont.Size; } }