Esempio n. 1
0
        public MessageForm(string Message, int Type)
        {
            InitializeComponent();

            if (Message.Length > 325)
            {
                this.Height       = 550;
                Messagelbl.Height = 481;
                iconPB.Location   = new Point(iconPB.Location.X, iconPB.Location.Y + 175);
            }

            switch (Type)
            {
            //Info message
            case 0:
                YESbtn.Hide();
                NObtn.Hide();
                iconPB.Image = System.Drawing.SystemIcons.Exclamation.ToBitmap();
                break;

            //Error message
            case 1:
                YESbtn.Hide();
                NObtn.Hide();
                iconPB.Image = System.Drawing.SystemIcons.Error.ToBitmap();
                break;

            //Succes message
            case 2:
                OKbtn.Hide();
                iconPB.Image = System.Drawing.SystemIcons.Information.ToBitmap();
                break;

            case 3:
                YESbtn.Hide();
                NObtn.Hide();
                iconPB.Image = System.Drawing.SystemIcons.Information.ToBitmap();
                break;

            case 4:
                YESbtn.Hide();
                NObtn.Hide();
                OKbtn.Hide();
                iconPB.Hide();
                Messagelbl.Hide();
                progressBar1.Show();
                label1.Show();
                Updater.Update(UIChange);
                break;

            default:
                break;
            }

            Messagelbl.Text = Message;
        }
Esempio n. 2
0
        public MessageForm(string Message, int Type, string texttoCB = null)
        {
            InitializeComponent();

            cliptext        = texttoCB;
            DialogResult    = DialogResult.No;
            Messagelbl.Text = Message;

            switch (Type)
            {
            //Info message
            case 0:
                YESbtn.Hide();
                NObtn.Hide();
                iconPB.Image = SystemIcons.Exclamation.ToBitmap();
                break;

            //Error message
            case 1:
                YESbtn.Hide();
                NObtn.Hide();
                iconPB.Image = SystemIcons.Error.ToBitmap();
                break;

            //Success message
            case 2:
                OKbtn.Hide();
                iconPB.Image = SystemIcons.Information.ToBitmap();
                break;

            case 3:
                this.Size = new Size(440, 336);
                OKbtn.Hide();
                iconPB.Hide();
                Messagelbl.Size      = new Size(382, 25);
                Messagelbl.Location  = new Point(18, 7);
                Messagelbl.TextAlign = ContentAlignment.TopCenter;
                Messagelbl.Text      = "ShortCute Design";
                Messagelbl.Font      = new Font("Bahnschrift SemiBold SemiConden", 14F);
                YESbtn.Text          = "Square";
                NObtn.Text           = "Rectangular";
                YESbtn.Location      = new Point(YESbtn.Location.X - 35, YESbtn.Location.Y);
                NObtn.Location       = new Point(NObtn.Location.X + 65, NObtn.Location.Y);

                PictureBox image;
                image = new PictureBox()
                {
                    Size        = new Size(200, 200),
                    Location    = new Point(15, 65),
                    SizeMode    = PictureBoxSizeMode.Zoom,
                    BorderStyle = BorderStyle.None,
                    Image       = Properties.Resources.square,
                };
                image.Click += YESbtn_Click;
                this.Controls.Add(image);

                PictureBox image2;
                image2 = new PictureBox()
                {
                    Size        = new Size(200, 252),
                    Location    = new Point(225, 40),
                    SizeMode    = PictureBoxSizeMode.Zoom,
                    BorderStyle = BorderStyle.None,
                    Image       = Properties.Resources.rectangular,
                };
                image2.Click += NObtn_Click;
                this.Controls.Add(image2);

                Size  tempsize  = image.Size;
                Point temppoint = image.Location;

                if (Message == "True")
                {
                    tempsize  = image2.Size;
                    temppoint = image2.Location;
                }

                Label borderPB;
                borderPB = new Label()
                {
                    Size        = new Size(tempsize.Width + 6, tempsize.Height + 6),
                    Location    = new Point(temppoint.X - 3, temppoint.Y - 3),
                    BorderStyle = BorderStyle.None,
                    BackColor   = Color.Red
                };
                this.Controls.Add(borderPB);
                break;

            case 4:
                progressBar1.Visible = true;
                OKbtn.Hide();
                YESbtn.Hide();
                NObtn.Hide();
                iconPB.Hide();
                closeBtn.Hide();

                Messagelbl.Size     = new Size(382, 75);
                Messagelbl.Location = new Point(18, 10);
                Messagelbl.Font     = new Font(Messagelbl.Font.FontFamily, Messagelbl.Font.Size + 5);
                Messagelbl.Text     = Updater.Message;
                Updater.Update(UIChange);
                break;

            //Info2 message
            case 5:
                NObtn.Hide();
                YESbtn.Text     = "Open GitHub";
                YESbtn.Location = new Point(YESbtn.Location.X + 55, YESbtn.Location.Y);
                YESbtn.Click   += Open_GitHub;
                iconPB.Image    = Properties.Resources.GitHub_logo;
                break;

            default:
                this.Size = new Size(440, 336);
                NObtn.Hide();
                YESbtn.Hide();
                iconPB.Hide();

                Messagelbl.Size     = new Size(382, 25);
                Messagelbl.Location = new Point(18, 7);
                Messagelbl.Font     = new Font(Messagelbl.Font.FontFamily, Messagelbl.Font.Size + 5);
                Messagelbl.Text     = "What u looking 4 here?";

                PictureBox dc = new PictureBox()
                {
                    Size                  = new Size(250, 250),
                    Location              = new Point(95, 40),
                    SizeMode              = PictureBoxSizeMode.Zoom,
                    BorderStyle           = BorderStyle.None,
                    BackgroundImageLayout = ImageLayout.Zoom,
                    BackgroundImage       = Properties.Resources.ShortCute,
                    InitialImage          = null,
                    ErrorImage            = null
                };
                dc.LoadAsync("https://cdn.discordapp.com/attachments/885633010475601951/974161761420853278/unknown.png");
                Controls.Add(dc);
                break;
            }

            closeBtn.Location = new Point(this.Size.Width - closeBtn.Width, 0);
        }