private void combFontSize_SelectedIndexChanged(object sender, EventArgs e) { float fsize = 12.0f; if (combFontSize.SelectedIndex > -1) { if (float.TryParse(combFontSize.SelectedItem.ToString(), out fsize)) { richTextBoxMessage.Tag = fsize.ToString(); IRichFormat richFomat = RichFormatFactory.CreateRichFormat(BTNType.FontSize); richFomat.SetFormat(this.richTextBoxMessage); } return; } }
public void btnButtonClick(object sender, EventArgs e) { Button btn = (Button)sender; BTNType btnType; if (Enum.TryParse <BTNType>(btn.Tag.ToString(), out btnType)) { if (btnType == BTNType.Search) { if (!string.IsNullOrEmpty(this.textBoxKey.Text.Trim())) { this.webBrowserMessage.Tag = this.textBoxKey.Text.Trim(); } else { return; } } IRichFormat richFomat = RichFormatFactory.CreateRichFormat(btnType); richFomat.SetFormat(this.richTextBoxMessage); } }