private void AddStyle_Click(object sender, EventArgs e) { var _f = new FormInput(); _f.Message = "Enter name for style"; var _r = _f.ShowDialog(); if (_r == DialogResult.OK) { var _style = new RtfControlStyle(); if (rtf.SelectionColor != null) { _style.Color = rtf.SelectionColor; } if (rtf.SelectionFont != null) { _style.FontFamily = rtf.SelectionFont.Name; _style.FontSize = rtf.SelectionFont.Size; _style.FontStyle = rtf.SelectionFont.Style; } _style.HorizontalAlignment = rtf.SelectionAlignment; _style.StyleName = _f.InputText; StyleCollection.Instance.Styles.Add(_style); _FontStyleComboBoxHelper.Add(_style); SetButtons(); } }