日期:2013-03-04  浏览次数:20444 次

//窗体,调用...

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.Threading;

namespace MazeDemo
{
/// <summary>
/// Form1 的摘要说明。
/// </summary>
public class Form1 : System.Windows.Forms.Form
{
private System.Windows.Forms.Button button1;
/// <summary>
/// 必需的设计器变量。
/// </summary>
///
private CMaze mymaze;
private System.Windows.Forms.Button button2;
private System.Windows.Forms.Button btnAbout;
private System.Windows.Forms.Button btnRun;
private System.Windows.Forms.Button btnReset;
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.Label label7;
private System.Windows.Forms.Label label8;
private System.Windows.Forms.Button button3;
private System.ComponentModel.IContainer components=null;

public Form1()
{
//
// Windows 窗体设计器支持所必需的
//
InitializeComponent();

//
// TODO: 在 InitializeComponent 调用后添加任何构造函数代码
//
bool[,] _mg=new bool[,]{{true,false,false,true,false,false,false},
{true,true,true,true,true,true,true},
{false,false,true,false,true,false,true},
{false,false,true,false,true,false,false},
{false,true,true,false,true,false,false},
{true,true,false,false,true,true,false},
{false,false,false,false,false,true,true}
};
mymaze=new CMaze(_mg,new Point(0,0),new Point(6,6));
}

/// <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.button1 = new System.Windows.Forms.Button();
this.button2 = new System.Windows.Forms.Button();
this.btnAbout = new System.Windows.Forms.Button();
this.btnRun = new System.Windows.Forms.Button();
this.btnReset = new System.Windows.Forms.Button();
this.panel1 = new System.Windows.Forms.Panel();
this.label8 = new System.Windows.Forms.Label();
this.label7 = new System.Windows.Forms.Label();
this.label6 = new System.Windows.Forms.Label();
this.label5 = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.label1 = new System.Windows.Forms.Label();
this.button3 = new System.Windows.Forms.Button();
this.panel1.SuspendLayout();
this.SuspendLayout();
//
// button1
//
this.button1.Location = new System.Drawing.Point(360, 288);
this.button1.Name = "button1";
this.button1.TabIndex = 0;
this.button1.Text = "Info";
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// button2
//
this.button2.Location = new System.Drawing.Point(360, 192);
this.button2.Name = "button2";
this.button2.TabIndex = 1;
this.button2.Text = "Step";
this.button2.Click += new System.EventHandler(this.but