Beispiel #1
0
        public string GetInputText(string description, string caption)
        {
            var view = new InputTextBox(description, caption);

            view.ShowDialog();
            return(view.ReturnedText);
        }
Beispiel #2
0
        private void button3_Click(object sender, EventArgs e)
        {
            string[] randomText = Resources.ResourceManager.GetObject("LoremIpsum").ToString().Split('.');
            List <CustomMessageBoxButton> buttons = new List <CustomMessageBoxButton>();

            for (int j = 0; j < 10; j++)
            {
                string textValue = StaticRandomizer.RandomInt(0, 10) > 6 ? randomText[StaticRandomizer.RandomInt(0, randomText.Length - 1)] : "";

                buttons.Clear();
                int buttonCount = StaticRandomizer.RandomInt(1, 5);
                for (int i = 0; i < buttonCount; i++)
                {
                    buttons.Add(new CustomMessageBoxButton(CustomButtonResult.Button1, randomText[StaticRandomizer.RandomInt(0, randomText.Length - 1)].Trim().Split(' ').FirstOrDefault()));
                }

                using (InputTextBox customMessageBox = new InputTextBox(textValue, randomText[StaticRandomizer.RandomInt(0, randomText.Length - 1)], "CustomMessageBox Demo", buttons.ToArray(), StaticRandomizer.RandomInt(1, buttonCount))
                {
                    StartPosition = FormStartPosition.CenterParent
                })
                {
                    customMessageBox.VerificationText = StaticRandomizer.RandomInt(0, 10) > 6 ? randomText[StaticRandomizer.RandomInt(0, randomText.Length - 1)] : "";
                    customMessageBox.ShowDialog();
                }
            }
        }
Beispiel #3
0
        public string GetUserInput(string hint)
        {
            InputTextBox inputDialog = new InputTextBox();

            inputDialog.Title = hint;
            inputDialog.ShowDialog();
            return(inputDialog.Result);
        }