Ejemplo n.º 1
0
        public static string Show(string text, string caption)
        {
            RadForm prompt = new RadForm();

            prompt.Width           = 500;
            prompt.Height          = 150;
            prompt.FormBorderStyle = FormBorderStyle.FixedDialog;
            prompt.Text            = caption;
            prompt.StartPosition   = FormStartPosition.CenterScreen;
            prompt.Anchor          = AnchorStyles.Right;
            prompt.ShowIcon        = false;

            RadLabel textLabel = new RadLabel()
            {
                Left = 50, Top = 20, Text = text, AutoSize = true
            };
            RadTextBox textBox = new RadTextBox()
            {
                Left = 50, Top = 50, Width = 400
            };
            RadButton confirmation = new RadButton()
            {
                Text = "Ok", Left = 350, Width = 100, Top = 70, DialogResult = DialogResult.OK
            };

            confirmation.Click += (sender, e) => { prompt.Close(); };
            prompt.Controls.Add(textBox);
            prompt.Controls.Add(confirmation);
            prompt.Controls.Add(textLabel);
            prompt.AcceptButton = confirmation;

            return(prompt.ShowDialog() == DialogResult.OK ? textBox.Text : "");
        }
Ejemplo n.º 2
0
        public void ShowLoginDialog()
        {
            var frm = new Views.Login.LoginView();

            //frm.MdiParent = _MainView;
            //frm.ThemeClassName = _MainView.ThemeClassName;
            frm.ThemeName = _MainView.ThemeName;

            var overlayForm = new RadForm();

            overlayForm.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
            overlayForm.ShowInTaskbar   = false;
            overlayForm.Width           = _MainView.Width;
            overlayForm.Height          = _MainView.Height;
            overlayForm.Top             = _MainView.Top;
            overlayForm.Left            = _MainView.Left;
            overlayForm.StartPosition   = _MainView.StartPosition;
            // Set the opacity to 75%.
            overlayForm.Opacity   = .75;
            overlayForm.MdiParent = _MainView;
            overlayForm.Show();
            frm.ShowDialog();
            overlayForm.Close();
            overlayForm.Dispose();
        }
Ejemplo n.º 3
0
        public static string Show(string text, string caption)
        {
            RadForm prompt = new RadForm();
            prompt.Width = 500;
            prompt.Height = 150;
            prompt.FormBorderStyle = FormBorderStyle.FixedDialog;
            prompt.Text = caption;
            prompt.StartPosition = FormStartPosition.CenterScreen;
            prompt.Anchor = AnchorStyles.Right;
            prompt.ShowIcon = false;

            RadLabel textLabel = new RadLabel() { Left = 50, Top = 20, Text = text, AutoSize = true };
            RadTextBox textBox = new RadTextBox() { Left = 50, Top = 50, Width = 400 };
            RadButton confirmation = new RadButton() { Text = "Ok", Left = 350, Width = 100, Top = 70, DialogResult = DialogResult.OK };
            confirmation.Click += (sender, e) => { prompt.Close(); };
            prompt.Controls.Add(textBox);
            prompt.Controls.Add(confirmation);
            prompt.Controls.Add(textLabel);
            prompt.AcceptButton = confirmation;

            return prompt.ShowDialog() == DialogResult.OK ? textBox.Text : "";
        }