📄 form1.cs
字号:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.IO;
namespace 拼图游戏
{
/// <summary>
/// Form1 的摘要说明。
/// </summary>
public class Form1 : System.Windows.Forms.Form
{
//****************************************
Timer t1 = new Timer();//Time的实例
int [] button = new int[25];
int second=-1;
int Cindex;
public int a=-1;
//---------------------------------------------------------------
ArrayList chen=new ArrayList();//暂时存放button上的图
ArrayList www = new ArrayList();//存放从文件读来的图
//后面会打乱。其中www的下标对应的是顺次的图片顺序,chen的下标对应的是打乱的图片顺序
Bitmap image=(Bitmap)Image.FromFile("我的爱人.JPG");
Bitmap chens;
//------------------------------------------------------------------------
public bool booltime0=false;public bool booltime1=false;
public bool booltime2=false;public bool booltime3=false;
public bool booltime4=false;public bool booltime5=false;
public bool booltime6=false;public bool booltime7=false;
public bool booltime8=false;public bool booltime9=false;
public bool booltime10=false;public bool booltime11=false;
public bool booltime12=false;public bool booltime13=false;
public bool booltime14=false;public bool booltime15=false;
public bool booltime16=false;public bool booltime17=false;
public bool booltime18=false;public bool booltime19=false;
public bool booltime20=false;public bool booltime21=false;
public bool booltime22=false;public bool booltime23=false;
public bool booltime24=false;
//****************************************************************
private System.Windows.Forms.Button button1;
private System.Windows.Forms.Button button2;
private System.Windows.Forms.Button button3;
private System.Windows.Forms.Button button4;
private System.Windows.Forms.Button button5;
private System.Windows.Forms.Button button6;
private System.Windows.Forms.Button button7;
private System.Windows.Forms.Button button8;
private System.Windows.Forms.Button button9;
private System.Windows.Forms.Button button10;
private System.Windows.Forms.Button button11;
private System.Windows.Forms.Button button12;
private System.Windows.Forms.Button button13;
private System.Windows.Forms.Button button14;
private System.Windows.Forms.Button button15;
private System.Windows.Forms.Button button16;
private System.Windows.Forms.Button button17;
private System.Windows.Forms.Button button18;
private System.Windows.Forms.Button button19;
private System.Windows.Forms.Button button20;
private System.Windows.Forms.Button button21;
private System.Windows.Forms.Button button22;
private System.Windows.Forms.Button button23;
private System.Windows.Forms.Button button24;
private System.Windows.Forms.Button button25;
private System.Windows.Forms.Button button26;
private System.Windows.Forms.Button button27;
private System.Windows.Forms.Button button28;
private System.Windows.Forms.Button button29;
private System.Windows.Forms.Button button30;
private System.Windows.Forms.Button button31;
private System.Windows.Forms.Button button32;
private System.Windows.Forms.Button button33;
private System.Windows.Forms.Button button34;
private System.Windows.Forms.Button button35;
private System.Windows.Forms.Button button36;
private System.Windows.Forms.Button button37;
private System.Windows.Forms.Button button38;
private System.Windows.Forms.Button button39;
private System.Windows.Forms.Button button40;
private System.Windows.Forms.Button button41;
private System.Windows.Forms.Button button42;
private System.Windows.Forms.Button button43;
private System.Windows.Forms.Button button44;
private System.Windows.Forms.Button button45;
private System.Windows.Forms.Button button46;
private System.Windows.Forms.Button button47;
private System.Windows.Forms.Button button48;
private System.Windows.Forms.Button button49;
private System.Windows.Forms.Button button50;
private System.Windows.Forms.Button button51;
private System.Windows.Forms.PictureBox pictureBox1;
private System.Windows.Forms.Button button52;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Timer timer1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label3;
private System.ComponentModel.IContainer components;
//********************************************************************
public Form1()
{
//
// Windows 窗体设计器支持所必需的
//
InitializeComponent();
//
// TODO: 在 InitializeComponent 调用后添加任何构造函数代码
//
}
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Windows 窗体设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
/// 此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
this.button1 = new System.Windows.Forms.Button();
this.button2 = new System.Windows.Forms.Button();
this.button3 = new System.Windows.Forms.Button();
this.button4 = new System.Windows.Forms.Button();
this.button5 = new System.Windows.Forms.Button();
this.button6 = new System.Windows.Forms.Button();
this.button7 = new System.Windows.Forms.Button();
this.button8 = new System.Windows.Forms.Button();
this.button9 = new System.Windows.Forms.Button();
this.button10 = new System.Windows.Forms.Button();
this.button11 = new System.Windows.Forms.Button();
this.button12 = new System.Windows.Forms.Button();
this.button13 = new System.Windows.Forms.Button();
this.button14 = new System.Windows.Forms.Button();
this.button15 = new System.Windows.Forms.Button();
this.button16 = new System.Windows.Forms.Button();
this.button17 = new System.Windows.Forms.Button();
this.button18 = new System.Windows.Forms.Button();
this.button19 = new System.Windows.Forms.Button();
this.button20 = new System.Windows.Forms.Button();
this.button21 = new System.Windows.Forms.Button();
this.button22 = new System.Windows.Forms.Button();
this.button23 = new System.Windows.Forms.Button();
this.button24 = new System.Windows.Forms.Button();
this.button25 = new System.Windows.Forms.Button();
this.button26 = new System.Windows.Forms.Button();
this.button27 = new System.Windows.Forms.Button();
this.button28 = new System.Windows.Forms.Button();
this.button29 = new System.Windows.Forms.Button();
this.button30 = new System.Windows.Forms.Button();
this.button31 = new System.Windows.Forms.Button();
this.button32 = new System.Windows.Forms.Button();
this.button33 = new System.Windows.Forms.Button();
this.button34 = new System.Windows.Forms.Button();
this.button35 = new System.Windows.Forms.Button();
this.button36 = new System.Windows.Forms.Button();
this.button37 = new System.Windows.Forms.Button();
this.button38 = new System.Windows.Forms.Button();
this.button39 = new System.Windows.Forms.Button();
this.button40 = new System.Windows.Forms.Button();
this.button41 = new System.Windows.Forms.Button();
this.button42 = new System.Windows.Forms.Button();
this.button43 = new System.Windows.Forms.Button();
this.button44 = new System.Windows.Forms.Button();
this.button45 = new System.Windows.Forms.Button();
this.button46 = new System.Windows.Forms.Button();
this.button47 = new System.Windows.Forms.Button();
this.button48 = new System.Windows.Forms.Button();
this.button49 = new System.Windows.Forms.Button();
this.button50 = new System.Windows.Forms.Button();
this.button51 = new System.Windows.Forms.Button();
this.pictureBox1 = new System.Windows.Forms.PictureBox();
this.button52 = new System.Windows.Forms.Button();
this.label1 = new System.Windows.Forms.Label();
this.timer1 = new System.Windows.Forms.Timer(this.components);
this.label2 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// button1
//
this.button1.BackColor = System.Drawing.Color.Black;
this.button1.Cursor = System.Windows.Forms.Cursors.NoMove2D;
this.button1.ForeColor = System.Drawing.Color.Black;
this.button1.Location = new System.Drawing.Point(27, 22);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(65, 70);
this.button1.TabIndex = 9;
this.button1.MouseDown += new System.Windows.Forms.MouseEventHandler(this.button1_MouseDown);
//
// button2
//
this.button2.BackColor = System.Drawing.Color.Black;
this.button2.Cursor = System.Windows.Forms.Cursors.NoMove2D;
this.button2.ForeColor = System.Drawing.Color.Black;
this.button2.Location = new System.Drawing.Point(89, 22);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(64, 70);
this.button2.TabIndex = 10;
this.button2.MouseDown += new System.Windows.Forms.MouseEventHandler(this.button2_MouseDown);
//
// button3
//
this.button3.BackColor = System.Drawing.Color.Black;
this.button3.Cursor = System.Windows.Forms.Cursors.NoMove2D;
this.button3.ForeColor = System.Drawing.Color.Black;
this.button3.Location = new System.Drawing.Point(151, 22);
this.button3.Name = "button3";
this.button3.Size = new System.Drawing.Size(64, 70);
this.button3.TabIndex = 11;
this.button3.MouseDown += new System.Windows.Forms.MouseEventHandler(this.button3_MouseDown);
//
// button4
//
this.button4.BackColor = System.Drawing.Color.Black;
this.button4.Cursor = System.Windows.Forms.Cursors.NoMove2D;
this.button4.ForeColor = System.Drawing.Color.Black;
this.button4.Location = new System.Drawing.Point(213, 22);
this.button4.Name = "button4";
this.button4.Size = new System.Drawing.Size(64, 70);
this.button4.TabIndex = 12;
this.button4.MouseDown += new System.Windows.Forms.MouseEventHandler(this.button4_MouseDown);
//
// button5
//
this.button5.BackColor = System.Drawing.Color.Black;
this.button5.Cursor = System.Windows.Forms.Cursors.NoMove2D;
this.button5.ForeColor = System.Drawing.Color.Black;
this.button5.Location = new System.Drawing.Point(274, 22);
this.button5.Name = "button5";
this.button5.Size = new System.Drawing.Size(65, 70);
this.button5.TabIndex = 13;
this.button5.MouseDown += new System.Windows.Forms.MouseEventHandler(this.button5_MouseDown);
//
// button6
//
this.button6.BackColor = System.Drawing.Color.Black;
this.button6.Cursor = System.Windows.Forms.Cursors.NoMove2D;
this.button6.ForeColor = System.Drawing.Color.Black;
this.button6.Location = new System.Drawing.Point(27, 90);
this.button6.Name = "button6";
this.button6.Size = new System.Drawing.Size(65, 70);
this.button6.TabIndex = 14;
this.button6.MouseDown += new System.Windows.Forms.MouseEventHandler(this.button6_MouseDown);
//
// button7
//
this.button7.BackColor = System.Drawing.Color.Black;
this.button7.Cursor = System.Windows.Forms.Cursors.NoMove2D;
this.button7.ForeColor = System.Drawing.Color.Black;
this.button7.Location = new System.Drawing.Point(89, 90);
this.button7.Name = "button7";
this.button7.Size = new System.Drawing.Size(64, 70);
this.button7.TabIndex = 15;
this.button7.MouseDown += new System.Windows.Forms.MouseEventHandler(this.button7_MouseDown);
//
// button8
//
this.button8.BackColor = System.Drawing.Color.Black;
this.button8.Cursor = System.Windows.Forms.Cursors.NoMove2D;
this.button8.ForeColor = System.Drawing.Color.Black;
this.button8.Location = new System.Drawing.Point(151, 90);
this.button8.Name = "button8";
this.button8.Size = new System.Drawing.Size(64, 70);
this.button8.TabIndex = 16;
this.button8.MouseDown += new System.Windows.Forms.MouseEventHandler(this.button8_MouseDown);
//
// button9
//
this.button9.BackColor = System.Drawing.Color.Black;
this.button9.Cursor = System.Windows.Forms.Cursors.NoMove2D;
this.button9.ForeColor = System.Drawing.Color.Black;
this.button9.Location = new System.Drawing.Point(213, 90);
this.button9.Name = "button9";
this.button9.Size = new System.Drawing.Size(64, 70);
this.button9.TabIndex = 17;
this.button9.MouseDown += new System.Windows.Forms.MouseEventHandler(this.button9_MouseDown);
//
// button10
//
this.button10.BackColor = System.Drawing.Color.Black;
this.button10.Cursor = System.Windows.Forms.Cursors.NoMove2D;
this.button10.ForeColor = System.Drawing.Color.Black;
this.button10.Location = new System.Drawing.Point(274, 90);
this.button10.Name = "button10";
this.button10.Size = new System.Drawing.Size(65, 70);
this.button10.TabIndex = 18;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -