//Khoi tao hien thi luot choi private void InitLuotChoi() { //Tao 1 panel luot choi pnLuotChoi = new RoundedPanel(); pnLuotChoi.Location = new Point(50, 20); pnLuotChoi.Size = new Size(130, 45); pnLuotChoi.BackColor = Color.FromArgb(255, 224, 192); pnLuotChoi.BorderStyle = BorderStyle.None; //Tao 1 pictureBox bieu tuong luot choi PictureBox picBoxLuotChoi = new PictureBox(); picBoxLuotChoi.Image = Image.FromFile(Application.StartupPath + @"\Picture BackGround\heart.jpg"); picBoxLuotChoi.SizeMode = PictureBoxSizeMode.StretchImage; picBoxLuotChoi.Size = new Size(33, 33); picBoxLuotChoi.Location = new Point(18, 6); //Tao 1 lable hien thi so luot choi lbLuotChoi = new Label(); lbLuotChoi.Location = new Point(picBoxLuotChoi.Location.X + 3, picBoxLuotChoi.Location.Y + 5); lbLuotChoi.ForeColor = Color.FromArgb(53, 45, 125); lbLuotChoi.TextAlign = ContentAlignment.MiddleCenter; lbLuotChoi.Font = new Font("Lucida Handwriting", 15, FontStyle.Bold); lbLuotChoi.Text = String.Format("{0}", luotChoi); //Them cac control vao panel pnLuotChoi.Controls.AddRange(new Control[] { picBoxLuotChoi, lbLuotChoi }); //Them cac control vao form this.Controls.Add(pnLuotChoi); }
//Khoi tao hien thi Coin private void InitCoin() { //Tao 1 panel coin pnCoin = new RoundedPanel(); pnCoin.Location = new Point(pnLuotChoi.Location.X + pnLuotChoi.Width + 50, pnLuotChoi.Location.Y); pnCoin.Size = new Size(135, 45); pnCoin.BackColor = Color.FromArgb(255, 224, 192); pnCoin.BorderStyle = BorderStyle.None; //Tao 1 pictureBox bieu tuong coin PictureBox picBoxCoin = new PictureBox(); picBoxCoin.Image = Image.FromFile(Application.StartupPath + @"\Picture BackGround\coin.jpg"); picBoxCoin.SizeMode = PictureBoxSizeMode.StretchImage; picBoxCoin.Size = new Size(35, 35); picBoxCoin.Location = new Point(18, 4); //Tao 1 lable hien thi so coin lbCoin = new Label(); lbCoin.Location = new Point(picBoxCoin.Location.X + 8, picBoxCoin.Location.Y + 5); lbCoin.ForeColor = Color.FromArgb(53, 45, 125); lbCoin.TextAlign = ContentAlignment.MiddleCenter; lbCoin.Font = new Font("Lucida Handwriting", 15, FontStyle.Bold); lbCoin.Text = String.Format("{0}", soCoin); //Them cac control vao panel pnCoin.Controls.AddRange(new Control[] { picBoxCoin, lbCoin }); //Them panel vao form this.Controls.Add(pnCoin); }