全文预览

C#面向对象课程设计--拼图游戏

上传者:非学无以广才 |  格式:doc  |  页数:19 |  大小:842KB

文档介绍
em.Text;Рusing System.Windows.Forms;Рnamespace 拼图游戏2Р{Р public partial class Form1 : FormР {Р public static int aa;Р public static int bb;Р private System.Windows.Forms.PictureBox[,] t; Р public Form1()Р {Р ponent();Р }Р //实例化数组Р private void Form1_Load(object sender, EventArgs e)Р {Р t = new PictureBox[3, 3]{{pictureBox1 ,pictureBox2 ,pictureBox3 }, Р {pictureBox4 ,pictureBox5 ,pictureBox6 }, Р {pictureBox7 ,pictureBox8 ,pictureBox9 } Р };Р for (int i = 0; i <= 2; i++)Р {Р for (int j = 0; j <= 2; j++)Р {Р t[i, j].Enabled = false;Р }Р } Р }Р //图片的移动Р private void pictureBox1_Click(object sender, EventArgs e)Р {Р bb++;Р label2.Text = bb.ToString();Р if (pictureBox2.Image == null)Р {Р pictureBox2.Image = pictureBox1.Image;Р pictureBox1.Image = null;Р }Р else if (pictureBox4.Image == null)Р {

收藏

分享

举报
下载此文档