public static Panel CreateBlock(string name, string username)
        {
            Panel BodyPanel = new Panel
            {
                Name      = username,
                Size      = new Size(417, 41),
                Region    = Region.FromHrgn(GDI.CreateRoundRectRgn(0, 0, 417, 41, 30, 30)),
                BackColor = Color.White
            };

            Label UserNameLabel = new Label
            {
                Text      = username,
                Dock      = DockStyle.Right,
                AutoSize  = false,
                Font      = new Font("Tahoma", 12, FontStyle.Regular),
                ForeColor = Theme.GetForeColor()
            };

            Label NameLabel = new Label
            {
                Text      = name,
                Dock      = DockStyle.Left,
                AutoSize  = false,
                Size      = new Size(BodyPanel.Size.Width / 2, UserNameLabel.Size.Height),
                Font      = new Font("Tahoma", 16, FontStyle.Bold),
                ForeColor = Theme.GetForeColor()
            };

            BodyPanel.Controls.Add(NameLabel);
            BodyPanel.Controls.Add(UserNameLabel);

            return(BodyPanel);
        }
Пример #2
0
        public static Panel CreateBlock(string name, int id)
        {
            Id = id;

            Panel Body = new Panel()
            {
                Name      = name,
                Size      = new Size(351, 56),
                Region    = Region.FromHrgn(GDI.CreateRoundRectRgn(0, 0, 351, 56, 6, 6)),
                Dock      = DockStyle.Left,
                BackColor = Color.White,
                //BorderStyle = BorderStyle.FixedSingle
            };

            PictureBox ImageBox = new PictureBox
            {
            };

            RoundButton AcceptBtn = new RoundButton()
            {
                Name                  = "aI" + id.ToString(),
                Size                  = new Size(28, 23),
                BackgroundImage       = Properties.Resources.Accept,
                BackgroundImageLayout = ImageLayout.Stretch,
                Location              = new Point(320, 3),
                Text                  = string.Empty,
                FlatStyle             = FlatStyle.Flat
            };

            AcceptBtn.FlatAppearance.BorderSize = 0;
            AcceptBtn.Click += AcceptBtn_Click;

            RoundButton RejectBtn = new RoundButton()
            {
                Name                  = "rI" + id.ToString(),
                Size                  = new Size(28, 23),
                BackgroundImage       = Properties.Resources.Reject,
                BackgroundImageLayout = ImageLayout.Stretch,
                Location              = new Point(320, 29),
                Text                  = string.Empty,
                FlatStyle             = FlatStyle.Flat
            };

            RejectBtn.FlatAppearance.BorderSize = 0;
            RejectBtn.Click += RejectBtn_Click;

            Body.Controls.Add(new Label
            {
                AutoSize  = false,
                Size      = new Size(Body.Size.Width - 100, 16),
                Location  = new Point(63, 5),
                Text      = "Solicitação de amizade",
                Font      = new Font("Tahoma", 10, FontStyle.Regular),
                ForeColor = Color.Black
            });

            Body.Controls.Add(new LeftLabel
            {
                AutoSize  = false,
                Size      = new Size(155, 13),
                Location  = new Point(60, 31),
                Text      = "Convite de amizade de " + name,
                Font      = new Font("Tahoma", 8, FontStyle.Regular),
                ForeColor = Color.Black
            });

            Body.Controls.Add(AcceptBtn);
            Body.Controls.Add(RejectBtn);

            return(Body);
        }