/// <summary> /// Shows the dialog static. /// </summary> /// <typeparam name="T"></typeparam> /// <param name="formText">The form text.</param> /// <param name="classInstance">The class instance.</param> /// <param name="overload">The overload.</param> /// <returns></returns> public static T ShowDialogStatic <T>(string formText, T classInstance, List <TextBoxItems> overload = null) where T : class { var mve = new MassVariableEdit(); return(mve.ShowDialog(formText, classInstance, overload)); }
public void changeMultiplierToolStripMenuItem_Click(object sender, EventArgs e) { var tb = (TextBox)ContextMenuStripExtras.GetContextParent(changeMultiplierToolStripMenuItem, typeof(TextBox)); var gp = Grid.GetPointFromTextBox(tb); if (gp == null) { MessageBox.Show("error setting multiplier value"); } if (gp.C == 0) return; var items = new List<MassVariableEdit.TextBoxItems> { new MassVariableEdit.TextBoxItems("Enter a letter multiplier for this grid square", "1", KeypressEvent, AcceptFinalTextBoxTextH,"Must be >=0 and a number"), new MassVariableEdit.TextBoxItems("Enter an extra word bonus multiplier. eg 1=2x score", "0",KeypressEvent, AcceptFinalTextBoxTextH, "Must be >=0 and a number") }; var mve = new MassVariableEdit(); var res = mve.ShowDialog("Enter the values", items); if (res == null) return; var lm1 = res[0].Item2; int lm11; int.TryParse(lm1, out lm11); var wm1 = res[1].Item2; int wm11; int.TryParse(wm1, out wm11); gp.LetterMultiplier = lm11; gp.WordMultiplierExtra = wm11; Solve(true); //set font if (lm11 != 1 || wm11 != 0) tb.Font = new Font(tb.Font.FontFamily, tb.Font.Size, FontStyle.Bold); else tb.Font = new Font(tb.Font.FontFamily, tb.Font.Size, FontStyle.Regular); }