Download presentation
Presentation is loading. Please wait.
1
Poker2.jpg Poker14.jpg int num1, num2; private void Form1_Load(object sender, EventArgs e) { pictureBox1.Enabled = false; pictureBox2.Enabled = false; pictureBox1.SizeMode = PictureBoxSizeMode.StretchImage; pictureBox2.SizeMode = PictureBoxSizeMode.StretchImage; pictureBox1.Image = new Bitmap("Pokerbk.jpg"); pictureBox2.Image = new Bitmap("Pokerbk.jpg"); lblMsg.Text = "按洗牌鈕遊戲開始.."; }
2
private void btnOK_Click(object sender, EventArgs e)
{ pictureBox1.Enabled = true; pictureBox2.Enabled = true; btnOK.Enabled = false; pictureBox1.Image = new Bitmap("Pokerbk.jpg"); pictureBox2.Image = new Bitmap("Pokerbk.jpg"); // pictureBox3.Image = null; // 清除 // 圖檔格式:bmp, gif, jpg, wmf, png, ico Random r = new Random(); num1 = r.Next(2, 15); // 產生亂數 2~14 num2 = r.Next(2, 15); lblMsg.Text = "請在撲克牌上按一下選取 .."; }
3
private void pictureBox1_Click(object sender, EventArgs e)
{ pictureBox1.Image = new Bitmap("Poker?.jpg"); pictureBox2.Image = new Bitmap("Poker?.jpg"); if (…) lblMsg.Text = " 你贏了 !"; else if (…) lblMsg.Text = " 平手 !"; else lblMsg.Text = " 你輸了 !"; pictureBox1.Enabled = false; pictureBox2.Enabled = false; btnOK.Enabled = true; }
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.