Example #1
0
        private void BTN_Prompt_Click(object sender, EventArgs e)
        {
            var prompt = new PromptForm("Hello World", "This is prompt windows form.");

            //prompt.SetFont(this.Font);
            prompt.ShowDialog();
        }
        public static DialogResult Prompt(string prompt, string title, string defaultValue,
                                          int xPos, int yPos, ref string value)
        {
            var form = new PromptForm();

            form.Text   = title;
            form.Prompt = prompt;
            form.Value  = defaultValue;

            if ((xPos > 0) || (yPos > 0))
            {
                form.StartPosition = FormStartPosition.Manual;
                form.Left          = xPos;
                form.Top           = yPos;
            }

            DialogResult dialogResult = form.ShowDialog();

            if (dialogResult == DialogResult.OK)
            {
                value = form.Value;
            }

            return(dialogResult);
        }
Example #3
0
 private void Prompt()
 {
     using (PromptForm form = new PromptForm(this.Text, this.MessageColour, this.MessageBold, this.Button1Text, this.Button2Text, this.Button3Text, this.MaskText))
     {
         form.Width  = this.Width;
         form.Height = this.Height;
         form.Text   = this.Title;
         form.ShowDialog();
         this.ButtonClickedText = form.ButtonClickedText;
         this.UserText          = form.UserText;
     }
 }
Example #4
0
        private void buildOrderToolStripMenuItem_Click(object sender, EventArgs e)
        {
            PromptForm pf = new PromptForm();

            pf.SetValue(obj.buildOrder.ToString());
            pf.SetCaption("Build Order for " + obj.Variable());
            pf.SetTitle("Enter the build order number");

            if (pf.ShowDialog() == DialogResult.OK)
            {
                try
                {
                    obj.buildOrder = int.Parse(pf.Value());
                }
                catch (Exception exc)
                {
                    MessageBox.Show(exc.Message, "Lynx2D Engine - Exception");
                }
            }
        }
        public static DialogResult Prompt(string prompt, string title, string defaultValue,
            int xPos, int yPos, ref string value)
        {
            var form = new PromptForm();
            form.Text = title;
            form.Prompt = prompt;
            form.Value = defaultValue;

            if ((xPos > 0) || (yPos > 0))
            {
                form.StartPosition = FormStartPosition.Manual;
                form.Left = xPos;
                form.Top = yPos;
            }

            DialogResult dialogResult = form.ShowDialog();
            if (dialogResult == DialogResult.OK)
                value = form.Value;

            return dialogResult;
        }