资源简介

这是用c#在vs2010环境中实现的拼图游戏,并附有使用说明文档,程序实现了拼图的基本功能,以及更换图片,选择难度,计时和统计步数。

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace WindowsApplication1
{
    public partial class Form1 : Form
    {
        private int t = 80;
        public Form1()
        {
            InitializeComponent();
        }

        private void timer1_Tick(object sender EventArgs e)
        {
            t--;
            if (t == 0)
            {
                Form3 f3 = new Form3();
                f3.Visible = true;
                timer1.Enabled = false;
            }
            this.toolStripStatusLabel1.Text = t.ToString();
            
            
        }

        private void 随机开始ToolStripMenuItem_Click(object sender EventArgs e)
        {
            for (int i = 0; i < 9; i++)
            {
                Random ran = new Random();
                int t1 = 1+ran.Next(9);
                Button bb = new Button();
                bb.BackgroundImage = this.getButton(t1).BackgroundImage;
                this.getButton(t1).BackgroundImage = this.getButton(i).BackgroundImage;
                this.getButton(i).BackgroundImage = bb.BackgroundImage;
            }
            t = 80;
            timer1.Enabled = true;
        }

        private Button getButton(int count)
        {
            if (count == 1)
            {
                return button1;
            }
            else if (count == 2)
            {
                return button2;
            }
            else if (count == 3)
            {
                return button3;
            }
            else if (count == 4)
            {
                return button4;
            }
            else if (count == 5)
            {
                return button5;
            }
            else if (count == 6)
            {
                return button6;
            }
            else if (count == 7)
            {
                return button7;
            }
            else if (count == 8)
            {
                return button8;
            }
            else if (count == 9)
            {
                return button9;
            }
            return button9;

        }

        private void 退出ToolStripMenuItem_Click(object sender EventArgs e)
        {
            Application.Exit();
        }

        private void button1_Click(object sender EventArgs e)
        {
            this.aaa(1);
        }

        private void button2_Click(object sender EventArgs e)
        {
            this.aaa(2);
        }

        private void button3_Click(object sender EventArgs e)
        {
            this.aaa(3);
        }

        private void aaa(int count)
        {
            if (this.getButton(count + 3).BackgroundImage == null)
            {
                this.getButton(count + 3).BackgroundImage = this.getButton(count).BackgroundImage;

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件      17287  2012-10-14 15:56  说明.docx

     文件        947  2012-10-10 16:31  putu\WindowsApplication1.sln

    ..A..H.     27136  2012-10-13 17:01  putu\WindowsApplication1.suo

     文件       6650  2012-10-10 16:31  putu\UpgradeLog.xml

     文件        478  2007-04-05 14:18  putu\WindowsApplication1\Program.cs

     文件       3699  2012-10-13 16:36  putu\WindowsApplication1\WindowsApplication1.csproj

     文件       8099  2012-10-13 16:57  putu\WindowsApplication1\Form1.cs

     文件      11795  2012-10-14 15:58  putu\WindowsApplication1\Form1.Designer.cs

     文件       6581  2012-10-13 16:57  putu\WindowsApplication1\Form1.resx

     文件      11608  2012-10-13 17:01  putu\WindowsApplication1\bin\Debug\WindowsApplication1.vshost.exe

     文件       4248  2012-10-06 08:28  putu\WindowsApplication1\bin\Debug\but.jpg

     文件       6040  2012-10-10 20:33  putu\WindowsApplication1\bin\Debug\dht.jpg

     文件      47459  2012-10-11 20:37  putu\WindowsApplication1\bin\Debug\butb.jpg

     文件      49261  2012-10-13 08:54  putu\WindowsApplication1\bin\Debug\dhtb.jpg

     文件      15360  2012-10-13 16:57  putu\WindowsApplication1\bin\Debug\WindowsApplication1.exe

     文件      36352  2012-10-13 16:57  putu\WindowsApplication1\bin\Debug\WindowsApplication1.pdb

     文件        490  2010-03-17 22:39  putu\WindowsApplication1\bin\Debug\WindowsApplication1.vshost.exe.manifest

     文件        446  2007-04-05 16:20  putu\WindowsApplication1\obj\WindowsApplication1.csproj.FileList.txt

     文件        958  2007-04-05 16:18  putu\WindowsApplication1\obj\Debug\WindowsApplication1.csproj.GenerateResource.Cache

     文件        180  2012-10-10 16:32  putu\WindowsApplication1\obj\Debug\WindowsApplication1.Form2.resources

     文件       5417  2012-10-13 16:57  putu\WindowsApplication1\obj\Debug\DesignTimeResolveAssemblyReferencesInput.cache

     文件       2611  2012-10-13 17:01  putu\WindowsApplication1\obj\Debug\WindowsApplication1.csproj.FileListAbsolute.txt

     文件        180  2012-10-13 16:57  putu\WindowsApplication1\obj\Debug\WindowsApplication1.Form1.resources

     文件        180  2012-10-13 16:36  putu\WindowsApplication1\obj\Debug\WindowsApplication1.Properties.Resources.resources

     文件        964  2012-10-13 16:57  putu\WindowsApplication1\obj\Debug\GenerateResource-ResGen.read.1.tlog

     文件       2130  2012-10-13 16:57  putu\WindowsApplication1\obj\Debug\GenerateResource-ResGen.write.1.tlog

     文件      15360  2012-10-13 16:57  putu\WindowsApplication1\obj\Debug\WindowsApplication1.exe

     文件      36352  2012-10-13 16:57  putu\WindowsApplication1\obj\Debug\WindowsApplication1.pdb

     文件       4608  2012-10-10 16:31  putu\WindowsApplication1\obj\Debug\TempPE\Properties.Resources.Designer.cs.dll

     文件       1190  2007-04-05 14:18  putu\WindowsApplication1\Properties\AssemblyInfo.cs

............此处省略42个文件信息

评论

共有 条评论