private void button2_Click(object sender, EventArgs e) { List <string> astr = new CMsgDlg().ShowDialogTextBox("Units", new string[] { "Enter units:", " " }); if (astr[0] == "Cancel") { return; } else { string unit = astr[1].Trim(); // Entered string Console.WriteLine("Units " + unit); } }
private void button1_Click(object sender, EventArgs e) { string res = new CMsgDlg().ShowDialog("Warning - the chosen filter is non-standard.", "Filter Warning", new string[] { "Filter", "Skip", "Cancel" }); if (res == "Cancel") { Console.WriteLine("Cancel"); } else if (res == "Skip") { Console.WriteLine("Skip"); } else if (res == "Filter") { Console.WriteLine("Filter"); } }
private void button3_Click(object sender, EventArgs e) { bool _bDistr = true, _bSign = false, _bShow = false; string chk_distr = (_bDistr ? CMsgDlg.escChk.ToString() : "") + "Distribution statement"; string chk_Sign = (_bSign ? CMsgDlg.escChk.ToString() : "") + "Sign document"; string chk_Show = (_bShow ? CMsgDlg.escChk.ToString() : "") + "Show report updates"; List <string> astr = new CMsgDlg().ShowDialogCheckBox("Check all that apply.", "Report Options", new string[] { chk_distr, chk_Sign, chk_Show }, new string[] { "\xdOK", "Cancel" }); if (astr[0] == "Cancel") { return; } else { _bDistr = (astr[1][0] == CMsgDlg.escChk); // Distr. statement _bSign = (astr[2][0] == CMsgDlg.escChk); // Sign _bShow = (astr[3][0] == CMsgDlg.escChk); // Show updates Console.WriteLine(_bDistr + "," + _bSign + "," + _bShow); } }