Beispiel #1
0
        static public string Show(string Prompt, string Title, string Default, int xPos, int yPos, bool isPassword)
        {
            if (Title == null)
            {
                Title = Application.ProductName;
            }
            frmInput dlg = new frmInput(Prompt, Title, xPos, yPos);

            if (isPassword)
            {
                dlg.txtInput.UseSystemPasswordChar = true;
            }
            if (Default != null)
            {
                dlg.txtInput.Text = Default;
            }
            DialogResult result = dlg.ShowDialog();

            if (result == DialogResult.Cancel)
            {
                return(null);
            }
            else
            {
                return(dlg.txtInput.Text);
            }
        }
Beispiel #2
0
        public static string ShowPrompt(string DialogTitle, string Description, string Prompt, string DefaultVal)
        {
            frmInput fInput = new frmInput(DialogTitle, Description, Prompt);
            fInput.txtInput.Text = DefaultVal;
            fInput.txtInput.SelectionStart = 0;
            fInput.txtInput.SelectionStart = fInput.txtInput.Text.Length;
            fInput.ShowDialog();

            string input = fInput.Tag.ToString();
            fInput.Dispose();

            return input;
        }
Beispiel #3
0
 private void btn3Level_Click(object sender, CommandEventArgs e)
 {
     foreach (Form frm in this.MdiChildren)
     {
         if (frm.Name == "frmInput")
         {
             frm.Activate();
             frm.Focus();
             return;
         }
     }
     frmInput frmInput = new frmInput();
     frmInput.MdiParent = this;
     frmInput.Show();
 }
Beispiel #4
0
		static public string Show(string Prompt, string Title, string Default, int xPos, int yPos, bool isPassword) {
			if (Title == null)
				Title = Application.ProductName;
			frmInput dlg = new frmInput(Prompt, Title, xPos, yPos);
			if (isPassword)
				dlg.txtInput.UseSystemPasswordChar = true;
			if (Default != null)
				dlg.txtInput.Text = Default;
			DialogResult result = dlg.ShowDialog();
			if (result == DialogResult.Cancel)
				return null;
			else
				return dlg.txtInput.Text;
		}