Пример #1
0
        public static Panel CreateBlock(string name, string text, string time)
        {
            Panel Body = new Panel()
            {
                Name        = name,
                Size        = new Size(288, 73),
                BorderStyle = BorderStyle.FixedSingle,
                BackColor   = Theme.GetBackColor()
            };

            PictureBox UserPic = new PictureBox()
            {
            };

            Body.Controls.Add(new Label()
            {
                AutoSize  = false,
                Size      = new Size(Body.Width - 120, 16),
                Location  = new Point(73, 6),
                Font      = new Font("Tahoma", 10, FontStyle.Bold),
                Text      = name,
                ForeColor = Theme.GetForeColor()
            });

            Body.Controls.Add(new Label()
            {
                Name      = "text",
                AutoSize  = false,
                Size      = new Size(Body.Width - 40, 13),
                Location  = new Point(73, 37),
                Font      = new Font("Tahoma", 8, FontStyle.Regular),
                Text      = text,
                ForeColor = Theme.GetForeColor()
            });

            Body.Controls.Add(new Label()
            {
                Name      = "time",
                Size      = new Size(60, 13),
                Location  = new Point(250, 55),
                Text      = time,
                ForeColor = Color.Gray
            });

            RoundButton Count = new RoundButton()
            {
                Name      = "count",
                Enabled   = false,
                Size      = new Size(27, 24),
                Location  = new Point(257, 5),
                FlatStyle = FlatStyle.Flat,
                BackColor = Color.LightGreen,
                ForeColor = Color.White,
                Text      = "1",
                Visible   = true
            };

            Count.FlatAppearance.BorderSize = 0;
            Body.Controls.Add(Count);

            Panel Cover = new Panel()
            {
                Size        = new Size(288, 73),
                BorderStyle = BorderStyle.None,
                BackColor   = Color.Transparent,
            };

            Cover.MouseEnter += Cover_MouseEnter;
            Cover.MouseLeave += Cover_MouseLeave;
            Cover.Click      += Cover_Click;
            Body.Controls.Add(Cover);

            return(Body);
        }
Пример #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);
        }