/// <summary> /// Called when the font combo box has changed. /// Ignores the event when the timer is updating the font combo Box /// to synchronize the editor selection with the font combo box. /// </summary> /// <param name="sender">the sender</param> /// <param name="e">EventArgs</param> private void fontComboBox_TextChanged(object sender, EventArgs e) { if (updatingFontName) { return; } FontFamily ff; try { ff = new FontFamily(fontComboBox.Text); } catch (Exception) { updatingFontName = true; fontComboBox.Text = FontName.GetName(0); updatingFontName = false; return; } FontName = ff; }
/// <summary> /// Called when the font combo box has changed. /// Ignores the event when the timer is updating the font combo Box /// to synchronize the editor selection with the font combo box. /// </summary> /// <param name="sender">the sender</param> /// <param name="e">EventArgs</param> private void fontComboBox_TextChanged(object sender, EventArgs e) { if (updatingFontName) { return; } FontFamily ff; try { ff = new FontFamily(fontComboBox.Text); } catch (Exception ex) { App.Model.TestDebugger.Instance.WriteError(ex); updatingFontName = true; fontComboBox.Text = FontName.GetName(0); updatingFontName = false; return; } FontName = ff; }
private void barEditItemFont_EditValueChanged(object sender, EventArgs e) { if (updatingFontName) { return; } FontFamily ff; try { //repositoryItemFontEdit1.font ff = new FontFamily(barEditItemFont.EditValue.ToString()); } catch (Exception) { //采用PV原语赋值 updatingFontName = true; barEditItemFont.EditValue = FontName.GetName(0); updatingFontName = false; return; } FontName = ff; }