Inheritance: MetroFramework.Forms.MetroForm
Esempio n. 1
0
 public static bool YesNo(string msg, int w=0, int h=0)
 {
     using (Dialogs form = new Dialogs())
     {
         form.btnNo.Text = "Não";
         form.pictureBox1.Image = Properties.Resources.about;
         form.metroTextBox3.Text = msg;
         if (w > 0)
             form.Width = w;
         if (h > 0)
             form.Height = Math.Max(150, h);
         return form.ShowDialog() == DialogResult.Yes;
     }
 }
Esempio n. 2
0
        public static void ShowMessage(string msg, int w, int h, System.Windows.Forms.MessageBoxIcon iconStyle, ScrollBars scrollBars = ScrollBars.None)
        {
            using (Dialogs form = new Dialogs())
            {
                form.btnYes.Visible = false;

                if (iconStyle == MessageBoxIcon.Information)
                    form.pictureBox1.Image = Properties.Resources.information;
                else if (iconStyle == MessageBoxIcon.Warning)
                    form.pictureBox1.Image = Properties.Resources.warning;
                else if (iconStyle == MessageBoxIcon.Error)
                    form.pictureBox1.Image = Properties.Resources.error;
                else
                    form.pictureBox1.Visible = false;

                form.metroTextBox3.Text = msg;
                form.metroTextBox3.ScrollBars = scrollBars;
                if (w > 0)
                    form.Width = w;
                if (h > 0)
                    form.Height = Math.Max(150, h);
                form.ShowDialog();
            }
        }