public void RewardShow() { if (Global.playReward()) { //System.Media.SystemSounds.Asterisk.Play(); sp_clap.Play(); } this.Visible = true; this.label2.Text = STName; this.label1.Visible = false; this.pictureBox1.Visible = false; this.label2.Visible = true; this.pictureBox2.Visible = true; this.label3.Visible = true; this.label3.Size = new System.Drawing.Size(288, 50); this.label3.Location = new System.Drawing.Point((screenWidth - this.label3.Width) / 2 + 10, pictureBox1.Top + 30); this.label3.Text = "恭喜获得奖励"; Random rd = new Random(); int picBoxHight = 0, picBoxWidth = 0; int rand = rd.Next(7) + 1;//[0,6] switch (rand) { case 1: this.pictureBox2.Image = global::RueHelper.Properties.Resources.reward_1; break; case 2: this.pictureBox2.Image = global::RueHelper.Properties.Resources.reward_2; break; case 3: this.pictureBox2.Image = global::RueHelper.Properties.Resources.reward_3; break; case 4: this.pictureBox2.Image = global::RueHelper.Properties.Resources.reward_4; break; case 5: this.pictureBox2.Image = global::RueHelper.Properties.Resources.reward_5; break; case 6: this.pictureBox2.Image = global::RueHelper.Properties.Resources.reward_6; break; case 7: this.pictureBox2.Image = global::RueHelper.Properties.Resources.reward_7; break; default: this.pictureBox2.Image = global::RueHelper.Properties.Resources.reward_1; break; } picBoxHight = pictureBox2.Image.Height; picBoxWidth = pictureBox2.Image.Width; this.pictureBox2.Size = new System.Drawing.Size(picBoxWidth, picBoxHight); this.pictureBox2.Location = new System.Drawing.Point((screenWidth - this.pictureBox2.Width) / 2, label2.Top - pictureBox2.Height - 80); System.Windows.Forms.Timer t = new System.Windows.Forms.Timer(); t.Interval = 2000; t.Tick += new EventHandler(t_Tick_Close); t.Start(); }
private void RewardStar_PrimarySchool() { if (Global.playReward()) { SetVol(0.4); //System.Media.SystemSounds.Asterisk.Play(); sp_clap.Play(); } this.Visible = true; this.label1.Visible = false; this.label2.Text = STName; this.label2.Visible = true; this.pictureBox1.Image = global::RueHelper.Properties.Resources.jiangli; this.pictureBox1.Location = new System.Drawing.Point(37, 218); this.pictureBox1.Name = "pictureBox1"; this.pictureBox1.Size = new System.Drawing.Size(397, 189); this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize; this.pictureBox2.Visible = true; this.pictureBox2.Size = new System.Drawing.Size(391, 200); this.pictureBox2.Location = new System.Drawing.Point((screenWidth - this.pictureBox2.Width) / 2, (screenHeight - this.pictureBox2.Height) / 2 - 170); Random rd = new Random(); int rand = rd.Next(7) + 1;//[0,6] switch (point) { case 1: this.pictureBox2.Image = global::RueHelper.Properties.Resources.star1_1; break; case 2: this.pictureBox2.Image = global::RueHelper.Properties.Resources.star1_2; break; case 3: this.pictureBox2.Image = global::RueHelper.Properties.Resources.star1_3; break; case 4: this.pictureBox2.Image = global::RueHelper.Properties.Resources.star1_4; break; case 5: this.pictureBox2.Image = global::RueHelper.Properties.Resources.star1_5; break; default: this.pictureBox2.Image = global::RueHelper.Properties.Resources.star1_3; break; } //int picBoxHight = 0, picBoxWidth = 0; //picBoxHight = pictureBox2.Image.Height; //picBoxWidth = pictureBox2.Image.Width; //this.pictureBox2.Size = new System.Drawing.Size(picBoxWidth, picBoxHight); //this.pictureBox2.Location = new System.Drawing.Point((screenWidth - this.pictureBox2.Width) / 2, label2.Top - pictureBox2.Height-80); this.Show(); System.Windows.Forms.Timer t = new System.Windows.Forms.Timer(); t.Interval = 2000; t.Tick += new EventHandler(t_Tick_Close); t.Start(); }