private void btnAddGame_Click(object sender, EventArgs e) { try { string lcReply = new InputBox(clsGame.FACTORY_PROMPT).Answer; if (!string.IsNullOrEmpty(lcReply)) { clsGame lcGame = clsGame.NewGame(lcReply[0]); if (lcGame != null) { if (txtGenreName.Enabled) { pushData(); Program.SvcClient.InsertGenre(_Genre); txtGenreName.Enabled = false; } lcGame.GameGenre = _Genre.GenreName; lcGame.EditDetails(); if (!string.IsNullOrEmpty(lcGame.GameName)) { refreshFormFromDB(_Genre.GenreName); frmMain.Instance.UpdateDisplay(); } } } } catch (Exception ex) { MessageBox.Show(ex.Message, "error adding"); } }
void AddConnectionClick(object sender, EventArgs e) { InputBox dlg; if (SelG >= 0) { ConnectionInfo NewCI = new ConnectionInfo(); SQLConnectForm ConnectUI = new SQLConnectForm(); if(ConnectUI.ShowDialog() == DialogResult.OK) { dlg = new InputBox(true, "New connection", "Name for the new connection"); dlg.SetInput(ConnectUI.SelectedDB); if (dlg.ShowDialog() != DialogResult.OK) return; else NewCI.Name = dlg.Input; NewCI.ConnectionString = ConnectUI.ConnectionString; CGs[SelG].Connections.Add(NewCI); LoadInfo(CGs[SelG]); } } else { MessageBox.Show("Select the connection group to whuch the new connection will be added", "Add connection", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } }
private void bTestInputBox_Click(object sender, EventArgs e) { InputBox inputBox = new InputBox("Input", "Input some text pleas"); inputBox.ShowDialog(this); if (inputBox.DialogResult == DialogResult.OK) { tbOutputText.Text = inputBox.InputTekst; } }
void AddGroupClick(object sender, EventArgs e) { InputBox dlg; dlg = new InputBox(true, "New connection group","Name for the new connection group"); if (dlg.ShowDialog() == DialogResult.OK) { ConnectionGroup aux = new ConnectionGroup(); aux.Name = dlg.Input; CGs.Add(aux); LoadInfo(); } }
private void OnValueSubmitted(InputBox sender, string oldValue) { if(this.Property != null) { string errorStr = this.Property.TrySetValue(m_InputBox.Text); if(errorStr != null) { m_InputBox.Text = oldValue; MessageBox.Show("Value Check Error: " + errorStr, "Invalid value", MessageBoxButtons.OK, MessageBoxIcon.Error); } } }
private void bTestInputBoxMultiInput_Click(object sender, EventArgs e) { string[] inputList = { "Name", "Lastname", "Address", "Phone number" }; InputBox inputBox = new InputBox("Input", inputList, "Input some text pleas"); inputBox.ShowDialog(this); if (inputBox.DialogResult == DialogResult.OK) { for (int i = 0; i < inputList.Length; i++) { tbOutputText.Text += inputList[i] + ": " + inputBox[i].Text + Environment.NewLine; } } }
private void bTestInputConfirmation_Click(object sender, EventArgs e) { string[] confirmationTextList = { "da", "yes", "ok", "delete", "obrisi", "obriši" }; InputBox inputBox = new InputBox("Input", "To delete file write 'delete' word", "", confirmationTextList); inputBox.InformationText = "To delete file pls write 'delete'"; inputBox.ShowDialog(this); if (inputBox.DialogResult == DialogResult.OK) { MessageBox.Show("User confirmed"); } else { MessageBox.Show("User say NO!!!!!!"); } }
private void btnStartFM_Click(object sender, EventArgs e) { try { InputBox ib = new InputBox(FormMessage.PLS_ENTER_FISCAL_ID + "(1-99999999) :", 8); if (ib.ShowDialog(this) == DialogResult.OK) { // Fiscal number int fiscalNumber = int.Parse(ib.input); if (fiscalNumber == 0 || fiscalNumber > 99999999) { bridge.Log(FormMessage.INAPPROPRIATE_FISCAL_ID); } CPResponse response = new CPResponse(bridge.Printer.StartFM(fiscalNumber)); ParseResponse(response); } } catch (FormatException fe) { bridge.Log(FormMessage.INAPPROPRIATE_FISCAL_ID); } catch (System.Exception ex) { bridge.Log(FormMessage.OPERATION_FAILS + ": " + ex.Message); } }
private void menuItemRename_Click(object sender,EventArgs e) { InputBox input=new InputBox(Lan.g(this,"Filename")); EmailAttach emailAttach=_listEmailAttachDisplayed[gridAttachments.SelectedIndices[0]]; input.textResult.Text=emailAttach.DisplayedFileName; input.ShowDialog(); if(input.DialogResult!=DialogResult.OK) { return; } emailAttach.DisplayedFileName=input.textResult.Text; FillAttachments(); }
private void OnRefPathSubmitted(InputBox sender, string oldValue) { m_Property.TrySetValue(sender.Text); }
private void SendTokenButton_Click(object sender, EventArgs e) { var input = new InputBox(); string to = null; var result = input.Show("Enter an email", "Email", "*****@*****.**", 300, 300, ref to); if (result == System.Windows.Forms.DialogResult.Cancel || string.IsNullOrEmpty(to)) { MessageBox.Show("Please enter an email to send the token to", "Enter email", MessageBoxButtons.OK, MessageBoxIcon.Error); return; } var token = GetTokenFormatted(); //var to = new MailAddress(ConfigurationManager.AppSettings["To"]); string subject = ConfigurationManager.AppSettings["Subject"] .Replace("{date}", DateTime.Now.ToString()); var smtp = new SmtpClient(); smtp.EnableSsl = smtp.Port == 587 || smtp.Port == 465; using (var message = new MailMessage() { Subject = subject, Body = token }) { message.To.Add(to); smtp.Send(message); } MessageBox.Show("Mail sent!"); }
private void buttonNewAmountCycles_Click(object sender, EventArgs e) { try { InputBox inputBox = new InputBox(); string inputBoxText = MultiLanguageStrings.GetString(Ressource.PackagesForm, "InputNameCaption.Text"); inputBox.Text = inputBoxText; inputBox.ShowDialog(); if (inputBox.Result != null) { listViewLoanCycles.Items.Clear(); buttonRemoveAmountCycles.Enabled = false; buttonAmountCyclesSave.Enabled = false; buttonAddAmountCycle.Enabled = true; panelAmountCycles.Enabled = true; panelAmountCycles.Visible = true; groupBoxAmountCycle.Text = MultiLanguageStrings.GetString(Ressource.FrmAddLoanProduct, "messageAmountCycle.Text"); buttonSave.Enabled = true; LoanCycle loanCycle = new LoanCycle(); loanCycle.Name = inputBox.Result; loanCycle.Id = ServicesProvider.GetInstance().GetProductServices().InsertLoanCycle(loanCycle); InitializeComboBoxLoanCycles(); SelectLoanCycleItemInComboBox(loanCycle.Id); groupBoxAmountCycle.Text = MultiLanguageStrings.GetString(Ressource.FrmAddLoanProduct, "messageAmountCycle.Text"); } } catch (Exception ex) { new frmShowError(CustomExceptionHandler.ShowExceptionText(ex)).ShowDialog(); } }
private void buttonSaveExoticProduct_Click(object sender, EventArgs e) { try { InputBox inPutBox = new InputBox(); inPutBox.ShowDialog(); if (inPutBox.Result != null) { _exoticProduct.Name = inPutBox.Result; _exoticProduct.Id = ServicesProvider.GetInstance().GetProductServices().AddExoticProduct(_exoticProduct, _product.LoanType); panelExoticProductNavigationButtons.Enabled = false; listViewExoticInstallments.Enabled = false; buttonAddExoticInstallment.Enabled = false; buttonRemoveExoticInstallment.Enabled = false; buttonSaveExoticProduct.Enabled = false; InitializeComboBoxExoticProduct(); comboBoxExoticProduct.Text = _exoticProduct.Name; _product.ExoticProduct = _exoticProduct; groupBoxExoticInstallmentProperties.Text = MultiLanguageStrings.GetString(Ressource.FrmAddLoanProduct, "messageExoticInstallment.Text"); panelExoticInstallment.Visible = false; } } catch (Exception ex) { new frmShowError(CustomExceptionHandler.ShowExceptionText(ex)).ShowDialog(); } }
private void OnOutRectSizeSubmitted(InputBox sender, string oldValue) { Rect2f rect = m_ShapeTemplateView.OutRect; rect.Size = sender.InterpretValueAsVector2(); m_ShapeTemplateView.OutRect = rect; }
public static string ShowInputBox() { InputBox box = new InputBox(); box.ShowDialog(); return box.textBox1.Text; }
private void OnTemplateNameSubmitted(InputBox sender, string oldValue) { if(this.Template != null) { RenameShapeTemplate(this.Template, sender.Text); } }
public void ShowBookMarkDialog() { InputBox inputBox1 = new InputBox(); inputBox1.label1.Text = "书签名称(&B):"; inputBox1.Text = "插入书签"; inputBox1.textBox1.Text = SelectionText; if (inputBox1.ShowDialog() == DialogResult.OK) { webBrowser1.Document.ExecCommand("CreateBookmark", false, inputBox1.textBox1.Text); } }
private void OnSelectedAngleSubmitted(InputBox sender, string oldValue) { if(this.SelectedManip != null) { float degree = sender.InterpretValueAsFloat(); this.SelectedManip.Angle = Helpers.Deg2Rad(degree); } }
private void OnSelectedPositionSubmitted(InputBox sender, string oldValue) { if(this.SelectedManip != null) { this.SelectedManip.Position = sender.InterpretValueAsVector2(); } }
private void OnPropertiesFilepathSubmitted(InputBox sender, string oldValue) { this.Template.PropertiesFilepath = m_PropertiesFilepathInputBox.Text; }
private void LockTabButton_Click(object sender, EventArgs e) { TabPage curTab = null; //get the clicked tab for (int i = 0; i < TabHolder.TabCount; ++i) { if (TabHolder.TabPages[i].Name.Equals(clickedTab, StringComparison.CurrentCultureIgnoreCase)) { curTab = TabHolder.TabPages[i]; break; } } if (curTab != null) { //Determine if the clicked tab is locked or unlocked if (LockTabButton.Tag.ToString().Equals("Lock", StringComparison.CurrentCultureIgnoreCase)) {//currently unlocked lockedTabs.Add(clickedTab); InputBox commentsInput = new InputBox(false, "Comments for results", "Add a comment for the tab to be locked(optional, will be a display on tab hover)"); commentsInput.ShowDialog(); curTab.ToolTipText = commentsInput.Input.Trim(); curTab.ImageIndex = 4; curTab.ForeColor = Color.Navy; } else {//currently locked lockedTabs.Remove(clickedTab); curTab.ToolTipText = ""; curTab.ImageIndex = 0; curTab.ForeColor = Color.Black; } } }
public void Search() { //правка-поиск //todo: rewrite with xwt InputBox ibx = new InputBox(new Localizator().GetString("FCVWhatFind")); if (!ibx.ShowDialog()) return; //если нажали отмену int startPos = txtBox.Text.IndexOf(ibx.Result,txtBox.SelectionStart + 1/*чтобы искать дальнейшие вхождения*/); if (startPos == -1) { MessageBox.Show(new Localizator().GetString("FCVNothingFound"), null, MessageBoxButtons.OK, MessageBoxIcon.Information); return; } txtBox.SelectionStart = startPos; txtBox.SelectionLength = ibx.Result.Length; LastSearch = ibx.Result; }