C#语言实例源码系列-游戏-实现华容道

news2024/11/16 23:32:30
专栏分享
  • 点击跳转=>Unity3D特效百例
  • 点击跳转=>案例项目实战源码
  • 点击跳转=>游戏脚本-辅助自动化
  • 点击跳转=>Android控件全解手册

👉关于作者

众所周知,人生是一个漫长的流程,不断克服困难,不断反思前进的过程。在这个过程中会产生很多对于人生的质疑和思考,于是我决定将自己的思考,经验和故事全部分享出来,以此寻找共鸣 !!!
专注于Android/Unity和各种游戏开发技巧,以及各种资源分享(网站、工具、素材、源码、游戏等)
有什么需要欢迎私我,交流群让学习不再孤单

在这里插入图片描述

👉实践过程

😜效果

在这里插入图片描述

😜代码

/**
 * https://zhima.blog.csdn.net/
 */
public partial class Form1 : Form
{
public Form1()
{
    InitializeComponent();
}

private Panel pl;//记录选中的控件ID

private void Form1_Load(object sender, EventArgs e)
{
    //初始化时设置各个位置的可用状态
    PlState[0, 0] = PlState[0, 1] = PlState[0, 2] = PlState[0, 3] =
        PlState[1, 0] = PlState[1, 1] = PlState[1, 2] = PlState[1, 3] =
        PlState[2, 0] = PlState[2, 1] = PlState[2, 2] = PlState[2, 3] =
        PlState[3, 0] = PlState[3, 1] = PlState[3, 2] = PlState[3, 3] =
        PlState[4, 0] = PlState[4, 3] = true;
}

//初始化各人物方格位置
private void button1_Click(object sender, EventArgs e)
{
    //设置各方格的初始图片
    panel1.BackgroundImage = (Image)(Properties.Resources._003);
    panel2.BackgroundImage = (Image)(Properties.Resources._001);
    panel3.BackgroundImage = (Image)(Properties.Resources._004);
    panel4.BackgroundImage = (Image)(Properties.Resources._005);
    panel5.BackgroundImage = (Image)(Properties.Resources._002);
    panel6.BackgroundImage = (Image)(Properties.Resources._006);
    panel7.BackgroundImage = (Image)(Properties.Resources._007);
    panel8.BackgroundImage = (Image)(Properties.Resources._008);
    panel9.BackgroundImage = (Image)(Properties.Resources._009);
    panel10.BackgroundImage = (Image)(Properties.Resources._010);
    //设置各方格的初始位置
    panel1.Location = position[0, 0];
    panel2.Location = position[0, 1];
    panel3.Location = position[0, 3];
    panel4.Location = position[2, 0];
    panel5.Location = position[2, 1];
    panel6.Location = position[2, 3];
    panel7.Location = position[3, 1];
    panel8.Location = position[3, 2];
    panel9.Location = position[4, 0];
    panel10.Location = position[4, 3];
    PlState[4, 0] = PlState[4, 3] = true;   //设置最后一行的首尾位置不可用
    PlState[4, 1] = PlState[4, 2] = false;  //设置最后一行的中间两个位置可用
}

#region 赵云
private void panel1_Click(object sender, EventArgs e)
{
    //设置各方格图片
    panel1.BackgroundImage = (Image)(Properties.Resources.a3);
    panel2.BackgroundImage = (Image)(Properties.Resources._001);
    panel3.BackgroundImage = (Image)(Properties.Resources._004);
    panel4.BackgroundImage = (Image)(Properties.Resources._005);
    panel5.BackgroundImage = (Image)(Properties.Resources._002);
    panel6.BackgroundImage = (Image)(Properties.Resources._006);
    panel7.BackgroundImage = (Image)(Properties.Resources._007);
    panel8.BackgroundImage = (Image)(Properties.Resources._008);
    panel9.BackgroundImage = (Image)(Properties.Resources._009);
    panel10.BackgroundImage = (Image)(Properties.Resources._010);
    PStyle = PStyles.P2V;//记录方格样式
    pl = panel1;         //记录选中的控件ID
    PosX = intX(panel1); //记录选中控件在坐标数组中的列索引
    PosY = intY(panel1); //记录选中控件在坐标数组中的行索引
}
#endregion

#region 曹操
private void panel2_Click(object sender, EventArgs e)
{
    panel1.BackgroundImage = (Image)(Properties.Resources._003);
    panel2.BackgroundImage = (Image)(Properties.Resources.a1);
    panel3.BackgroundImage = (Image)(Properties.Resources._004);
    panel4.BackgroundImage = (Image)(Properties.Resources._005);
    panel5.BackgroundImage = (Image)(Properties.Resources._002);
    panel6.BackgroundImage = (Image)(Properties.Resources._006);
    panel7.BackgroundImage = (Image)(Properties.Resources._007);
    panel8.BackgroundImage = (Image)(Properties.Resources._008);
    panel9.BackgroundImage = (Image)(Properties.Resources._009);
    panel10.BackgroundImage = (Image)(Properties.Resources._010);
    PStyle = PStyles.P4;
    pl = panel2;
    PosX = intX(panel2);
    PosY = intY(panel2);
}
#endregion

#region 张飞
private void panel3_Click(object sender, EventArgs e)
{
    panel1.BackgroundImage = (Image)(Properties.Resources._003);
    panel2.BackgroundImage = (Image)(Properties.Resources._001);
    panel3.BackgroundImage = (Image)(Properties.Resources.a4);
    panel4.BackgroundImage = (Image)(Properties.Resources._005);
    panel5.BackgroundImage = (Image)(Properties.Resources._002);
    panel6.BackgroundImage = (Image)(Properties.Resources._006);
    panel7.BackgroundImage = (Image)(Properties.Resources._007);
    panel8.BackgroundImage = (Image)(Properties.Resources._008);
    panel9.BackgroundImage = (Image)(Properties.Resources._009);
    panel10.BackgroundImage = (Image)(Properties.Resources._010);
    PStyle = PStyles.P2V;
    pl = panel3;
    PosX = intX(panel3);
    PosY = intY(panel3);
}
#endregion

#region 马超
private void panel4_Click(object sender, EventArgs e)
{
    panel1.BackgroundImage = (Image)(Properties.Resources._003);
    panel2.BackgroundImage = (Image)(Properties.Resources._001);
    panel3.BackgroundImage = (Image)(Properties.Resources._004);
    panel4.BackgroundImage = (Image)(Properties.Resources.a5);
    panel5.BackgroundImage = (Image)(Properties.Resources._002);
    panel6.BackgroundImage = (Image)(Properties.Resources._006);
    panel7.BackgroundImage = (Image)(Properties.Resources._007);
    panel8.BackgroundImage = (Image)(Properties.Resources._008);
    panel9.BackgroundImage = (Image)(Properties.Resources._009);
    panel10.BackgroundImage = (Image)(Properties.Resources._010);
    PStyle = PStyles.P2V;
    pl = panel4;
    PosX = intX(panel4);
    PosY = intY(panel4);
}
#endregion

#region 关羽
private void panel5_Click(object sender, EventArgs e)
{
    panel1.BackgroundImage = (Image)(Properties.Resources._003);
    panel2.BackgroundImage = (Image)(Properties.Resources._001);
    panel3.BackgroundImage = (Image)(Properties.Resources._004);
    panel4.BackgroundImage = (Image)(Properties.Resources._005);
    panel5.BackgroundImage = (Image)(Properties.Resources.a2);
    panel6.BackgroundImage = (Image)(Properties.Resources._006);
    panel7.BackgroundImage = (Image)(Properties.Resources._007);
    panel8.BackgroundImage = (Image)(Properties.Resources._008);
    panel9.BackgroundImage = (Image)(Properties.Resources._009);
    panel10.BackgroundImage = (Image)(Properties.Resources._010);
    PStyle = PStyles.P2H;
    pl = panel5;
    PosX = intX(panel5);
    PosY = intY(panel5);
}
#endregion

#region 黄忠
private void panel6_Click(object sender, EventArgs e)
{
    panel1.BackgroundImage = (Image)(Properties.Resources._003);
    panel2.BackgroundImage = (Image)(Properties.Resources._001);
    panel3.BackgroundImage = (Image)(Properties.Resources._004);
    panel4.BackgroundImage = (Image)(Properties.Resources._005);
    panel5.BackgroundImage = (Image)(Properties.Resources._002);
    panel6.BackgroundImage = (Image)(Properties.Resources.a6);
    panel7.BackgroundImage = (Image)(Properties.Resources._007);
    panel8.BackgroundImage = (Image)(Properties.Resources._008);
    panel9.BackgroundImage = (Image)(Properties.Resources._009);
    panel10.BackgroundImage = (Image)(Properties.Resources._010);
    PStyle = PStyles.P2V;
    pl = panel6;
    PosX = intX(panel6);
    PosY = intY(panel6);
}
#endregion

#region 士兵一
private void panel7_Click(object sender, EventArgs e)
{
    panel1.BackgroundImage = (Image)(Properties.Resources._003);
    panel2.BackgroundImage = (Image)(Properties.Resources._001);
    panel3.BackgroundImage = (Image)(Properties.Resources._004);
    panel4.BackgroundImage = (Image)(Properties.Resources._005);
    panel5.BackgroundImage = (Image)(Properties.Resources._002);
    panel6.BackgroundImage = (Image)(Properties.Resources._006);
    panel7.BackgroundImage = (Image)(Properties.Resources.a7);
    panel8.BackgroundImage = (Image)(Properties.Resources._008);
    panel9.BackgroundImage = (Image)(Properties.Resources._009);
    panel10.BackgroundImage = (Image)(Properties.Resources._010);
    PStyle = PStyles.P1;
    pl = panel7;
    PosX = intX(panel7);
    PosY = intY(panel7);
}
#endregion

#region 士兵二
private void panel8_Click(object sender, EventArgs e)
{
    panel1.BackgroundImage = (Image)(Properties.Resources._003);
    panel2.BackgroundImage = (Image)(Properties.Resources._001);
    panel3.BackgroundImage = (Image)(Properties.Resources._004);
    panel4.BackgroundImage = (Image)(Properties.Resources._005);
    panel5.BackgroundImage = (Image)(Properties.Resources._002);
    panel6.BackgroundImage = (Image)(Properties.Resources._006);
    panel7.BackgroundImage = (Image)(Properties.Resources._007);
    panel8.BackgroundImage = (Image)(Properties.Resources.a8);
    panel9.BackgroundImage = (Image)(Properties.Resources._009);
    panel10.BackgroundImage = (Image)(Properties.Resources._010);
    PStyle = PStyles.P1;
    pl = panel8;
    PosX = intX(panel8);
    PosY = intY(panel8);
}
#endregion

#region 士兵三
private void panel9_Click(object sender, EventArgs e)
{
    panel1.BackgroundImage = (Image)(Properties.Resources._003);
    panel2.BackgroundImage = (Image)(Properties.Resources._001);
    panel3.BackgroundImage = (Image)(Properties.Resources._004);
    panel4.BackgroundImage = (Image)(Properties.Resources._005);
    panel5.BackgroundImage = (Image)(Properties.Resources._002);
    panel6.BackgroundImage = (Image)(Properties.Resources._006);
    panel7.BackgroundImage = (Image)(Properties.Resources._007);
    panel8.BackgroundImage = (Image)(Properties.Resources._008);
    panel9.BackgroundImage = (Image)(Properties.Resources.a9);
    panel10.BackgroundImage = (Image)(Properties.Resources._010);
    PStyle = PStyles.P1;
    pl = panel9;
    PosX = intX(panel9);
    PosY = intY(panel9);
}
#endregion

#region 士兵四
private void panel10_Click(object sender, EventArgs e)
{
    panel1.BackgroundImage = (Image)(Properties.Resources._003);
    panel2.BackgroundImage = (Image)(Properties.Resources._001);
    panel3.BackgroundImage = (Image)(Properties.Resources._004);
    panel4.BackgroundImage = (Image)(Properties.Resources._005);
    panel5.BackgroundImage = (Image)(Properties.Resources._002);
    panel6.BackgroundImage = (Image)(Properties.Resources._006);
    panel7.BackgroundImage = (Image)(Properties.Resources._007);
    panel8.BackgroundImage = (Image)(Properties.Resources._008);
    panel9.BackgroundImage = (Image)(Properties.Resources._009);
    panel10.BackgroundImage = (Image)(Properties.Resources.a10);
    PStyle = PStyles.P1;
    pl = panel10;
    PosX = intX(panel10);
    PosY = intY(panel10);
}
#endregion

#region 判断是否成功
///<summary>
///判断是否成功
///</summary>
///<returns>true表示成功,false表示失败</returns>
private bool Successful()
{
    if (panel2.Location == new Point(108, 343))
    {
        MessageBox.Show("恭喜你,曹操已经成功逃离华容道!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
        return true;
    }
    else
        return false;
}
#endregion

//通过按键盘上的上、下、左、右键来移动人物方格
private void Form1_KeyUp(object sender, KeyEventArgs e)
{
    blUp = blDown = blLeft = blRight = false;//设置上、下、左、右方向移动不可用  
    switch (e.KeyData)
    {
        case Keys.Up:       //向上移动
            blUp = true;
            break;
        case Keys.Down:     //向下移动
            blDown = true;
            break;
        case Keys.Left:     //向左移动
            blLeft = true;
            break;
        case Keys.Right:    //向右移动
            blRight = true;
            break;
    }
    MovePosition(pl, PosX, PosY);//移动人物方格位置
    if (Successful())//判断是否成功
        button1_Click(sender, e);//重新开始
}

//定义每个人物方格的大小, 共有x*y(x=4, y=5)个人物方格
public enum plEnumerate : int
{
    plSize = 100,   //人物方格大小
    plX = 4,        //定义列
    plY = 5,        //定义行
};

//判断索引位置是否可用
public bool[,] PlState = new bool[(int)plEnumerate.plY, (int)plEnumerate.plX];

//定义一个数组,用来记录各人物方格位置
private Point[,] position = new Point[5, 4] {
    { new Point(8, 43), new Point(108, 43), new Point(208, 43), new Point(308, 43) },
    { new Point(8, 143), new Point(108, 143), new Point(208, 143), new Point(308, 143) },
    { new Point(8, 243), new Point(108, 243), new Point(208, 243), new Point(308, 243) },
    { new Point(8, 343), new Point(108, 343), new Point(208, 343), new Point(308, 343) },
    { new Point(8, 443), new Point(108, 443), new Point(208, 443), new Point(308, 443) },
};

//获取人物方格的位置
public Point[,] GetPosition()
{
    return this.position;
}

//定义各人物方格的形状
public enum PStyles : int
{
    P1 = 0,//口
    P4 = 1,//田
    P2V = 2,//日
    P2H = 3,//口口
};

private int m_PStyle;//获取人物样式的编号

//记录人物样式形状
public PStyles PStyle
{
    get { return (PStyles)this.m_PStyle; }
    set { this.m_PStyle = (int)value; }
}

private int m_X = 0, m_Y = 0;//记录人物方格索引

//返回人物方格列索引
public int PosX
{
    get { return this.m_X; }
    set { this.m_X = value; }
}

//返回人物方格行索引
public int PosY
{
    get { return this.m_Y; }
    set { this.m_Y = value; }
}

#region 计算选中的人物方格在数组中的列索引
///<summary>
///计算选中的人物方格在数组中的列索引
///</summary>
///<param name="pl">选中的Panel控件</param>
///<returns>列索引</returns>
private int intX(Panel pl)
{
    int i = pl.Location.X - 8;
    return i / 100;
}
#endregion

#region 计算选中的人物方格在数组中的行索引
///<summary>
///计算选中的人物方格在数组中的行索引
///</summary>
///<param name="pl">选中的Panel控件</param>
///<returns>行索引</returns>
private int intY(Panel pl)
{
    int i = pl.Location.Y - 43;
    return i / 100;
}
#endregion

//定义4个变量,分别用来表示向上、下、左、右移动
private bool blUp, blDown, blLeft, blRight;

#region 移动人物位置
///<summary>
///移动人物位置
///</summary>
///<param name="pl">要移动的控件名称</param>
///<param name="x">横坐标在坐标数组中的索引</param>
///<param name="y">纵坐标在坐标数组中的索引</param>
///<returns>是否移动成功</returns>
public bool MovePosition(Panel pl, int x, int y)
{
    #region 上移
    if (blUp && (y - 1) >= 0)
    {
        switch (PStyle)
        {
            case PStyles.P4://case PStyles.P2H://口口
                if (!PlState[y - 1, x] && !PlState[y - 1, x + 1])
                {
                    pl.Location = GetPosition()[y - 1, x];
                    if (PStyle == PStyles.P4)//田
                    {
                        PlState[y + 1, x] = false;
                        PlState[y + 1, x + 1] = false;
                    }
                    else if (PStyle == PStyles.P2H)//口口
                    {
                        PlState[y, x] = false;
                        PlState[y, x + 1] = false;
                    }
                    PlState[y - 1, x] = true;
                    PlState[y - 1, x + 1] = true;
                    PosY -= 1;
                    return true;
                }
                else return false;
            case PStyles.P2V://case PStyles.P1://if (!PlState[y - 1, x])
                {
                    pl.Location = GetPosition()[y - 1, x];
                    if (PStyle == PStyles.P2V)//日
                    {
                        PlState[y + 1, x] = false;
                    }
                    else if (PStyle == PStyles.P1)//口
                    {
                        PlState[y, x] = false;
                    }
                    PlState[y - 1, x] = true;
                    PosY -= 1;
                    return true;
                }
                else return false;
        }
    }
    #endregion
    #region 下移
    else if (blDown)
    {
        switch (PStyle)
        {
            case PStyles.P4://if ((y + 2) < (int)plEnumerate.plY && !PlState[y + 2, x] && !PlState[y + 2, x + 1])
                {
                    pl.Location = GetPosition()[y + 1, x];
                    PlState[y, x] = false;
                    PlState[y, x + 1] = false;
                    PlState[y + 2, x] = true;
                    PlState[y + 2, x + 1] = true;
                    PosY += 1;
                    return true;
                }
                else return false;
            case PStyles.P2V://if ((y + 2) < (int)plEnumerate.plY && !PlState[y + 2, x])
                {
                    pl.Location = GetPosition()[y + 1, x];
                    PlState[y, x] = false;
                    PlState[y + 2, x] = true;
                    PosY += 1;
                    return true;
                }
                else return false;
            case PStyles.P1://if ((y + 1) < (int)plEnumerate.plY && !PlState[y + 1, x])
                {
                    pl.Location = GetPosition()[y + 1, x];
                    PlState[y, x] = false;
                    PlState[y + 1, x] = true;
                    PosY += 1;
                    return true;
                }
                else return false;
            case PStyles.P2H://口口
                if ((y + 1) < (int)plEnumerate.plY && !PlState[y + 1, x] && !PlState[y + 1, x + 1])
                {
                    pl.Location = GetPosition()[y + 1, x];
                    PlState[y, x] = false;
                    PlState[y, x + 1] = false;
                    PlState[y + 1, x] = true;
                    PlState[y + 1, x + 1] = true;
                    PosY += 1;
                    return true;
                }
                else return false;
        }
    }
    #endregion
    #region 左移
    else if (blLeft)
    {
        switch (PStyle)
        {
            case PStyles.P2V://case PStyles.P4://if (x - 1 >= 0 && !PlState[y, x - 1] && !PlState[y + 1, x - 1])
                {
                    pl.Location = GetPosition()[y, x - 1];
                    switch (PStyle)
                    {
                        case PStyles.P4://田
                            PlState[y, x + 1] = false;
                            PlState[y + 1, x + 1] = false;
                            break;

                        case PStyles.P2V://日
                            PlState[y, x] = false;
                            PlState[y + 1, x] = false;
                            break;
                    }
                    PlState[y, x - 1] = true;
                    PlState[y + 1, x - 1] = true;
                    PosX -= 1;
                    return true;
                }
                else return false;
            case PStyles.P1://case PStyles.P2H://口口
                if (x - 1 >= 0 && !PlState[y, x - 1])
                {
                    pl.Location = GetPosition()[y, x - 1];
                    if (PStyle == PStyles.P2H)//口口
                    {
                        PlState[y, x + 1] = false;
                    }
                    else
                    {
                        PlState[y, x] = false;
                    }
                    PlState[y, x - 1] = true;
                    PosX -= 1;
                    return true;
                }
                else return false;
        }
    }
    #endregion
    #region 右移
    else if (blRight)
    {
        switch (PStyle)
        {
            case PStyles.P4://if (x + 2 < (int)plEnumerate.plX && !PlState[y, x + 2] && !PlState[y + 1, x + 2])
                {
                    pl.Location = GetPosition()[y, x + 1];
                    PlState[y, x] = false;
                    PlState[y + 1, x] = false;
                    PlState[y, x + 2] = true;
                    PlState[y + 1, x + 2] = true;
                    PosX += 1;
                    return true;
                }
                else return false;
            case PStyles.P1://if (x + 1 < (int)plEnumerate.plX && !PlState[y, x + 1])
                {
                    pl.Location = GetPosition()[y, x + 1];
                    PlState[y, x] = false;
                    PlState[y, x + 1] = true;
                    PosX += 1;
                    return true;
                }
                else return false;
            case PStyles.P2H://口口
                if (x + 2 < (int)plEnumerate.plX && !PlState[y, x + 2])
                {
                    pl.Location = GetPosition()[y, x + 1];
                    PlState[y, x] = false;
                    PlState[y, x + 2] = true;
                    PosX += 1;
                    return true;
                }
                else return false;
            case PStyles.P2V://if (x + 1 < (int)plEnumerate.plX && !PlState[y, x + 1] && !PlState[y + 1, x + 1])
                {
                    pl.Location = GetPosition()[y, x + 1];
                    PlState[y, x] = false;
                    PlState[y + 1, x] = false;
                    PlState[y, x + 1] = true;
                    PlState[y + 1, x + 1] = true;
                    PosX += 1;
                    return true;
                }
                else return false;
        }
    }
    #endregion
    return false;
}      
#endregion
}
partial class Form1
{
    /// <summary>
    /// 必需的设计器变量。
    /// </summary>
    private System.ComponentModel.IContainer components = null;

    /// <summary>
    /// 清理所有正在使用的资源。
    /// </summary>
    /// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
    protected override void Dispose(bool disposing)
    {
        if (disposing && (components != null))
        {
            components.Dispose();
        }
        base.Dispose(disposing);
    }

    #region Windows 窗体设计器生成的代码

    /// <summary>
    /// 设计器支持所需的方法 - 不要
    /// 使用代码编辑器修改此方法的内容。
    /// </summary>
    private void InitializeComponent()
    {
        this.panel1 = new System.Windows.Forms.Panel();
        this.panel2 = new System.Windows.Forms.Panel();
        this.panel3 = new System.Windows.Forms.Panel();
        this.panel4 = new System.Windows.Forms.Panel();
        this.panel5 = new System.Windows.Forms.Panel();
        this.panel6 = new System.Windows.Forms.Panel();
        this.panel7 = new System.Windows.Forms.Panel();
        this.panel8 = new System.Windows.Forms.Panel();
        this.panel9 = new System.Windows.Forms.Panel();
        this.panel10 = new System.Windows.Forms.Panel();
        this.button1 = new System.Windows.Forms.Button();
        this.SuspendLayout();
        // 
        // panel1
        // 
        this.panel1.BackgroundImage = global::HuaRongDao.Properties.Resources._003;
        this.panel1.Location = new System.Drawing.Point(8, 43);
        this.panel1.Name = "panel1";
        this.panel1.Size = new System.Drawing.Size(100, 200);
        this.panel1.TabIndex = 0;
        this.panel1.Click += new System.EventHandler(this.panel1_Click);
        // 
        // panel2
        // 
        this.panel2.BackgroundImage = global::HuaRongDao.Properties.Resources._001;
        this.panel2.Location = new System.Drawing.Point(108, 43);
        this.panel2.Name = "panel2";
        this.panel2.Size = new System.Drawing.Size(200, 200);
        this.panel2.TabIndex = 0;
        this.panel2.Click += new System.EventHandler(this.panel2_Click);
        // 
        // panel3
        // 
        this.panel3.BackgroundImage = global::HuaRongDao.Properties.Resources._004;
        this.panel3.Location = new System.Drawing.Point(308, 43);
        this.panel3.Name = "panel3";
        this.panel3.Size = new System.Drawing.Size(100, 200);
        this.panel3.TabIndex = 1;
        this.panel3.Click += new System.EventHandler(this.panel3_Click);
        // 
        // panel4
        // 
        this.panel4.BackgroundImage = global::HuaRongDao.Properties.Resources._005;
        this.panel4.Location = new System.Drawing.Point(8, 243);
        this.panel4.Name = "panel4";
        this.panel4.Size = new System.Drawing.Size(100, 200);
        this.panel4.TabIndex = 2;
        this.panel4.Click += new System.EventHandler(this.panel4_Click);
        // 
        // panel5
        // 
        this.panel5.BackgroundImage = global::HuaRongDao.Properties.Resources._002;
        this.panel5.Location = new System.Drawing.Point(108, 243);
        this.panel5.Name = "panel5";
        this.panel5.Size = new System.Drawing.Size(200, 100);
        this.panel5.TabIndex = 3;
        this.panel5.Click += new System.EventHandler(this.panel5_Click);
        // 
        // panel6
        // 
        this.panel6.BackgroundImage = global::HuaRongDao.Properties.Resources._006;
        this.panel6.Location = new System.Drawing.Point(308, 243);
        this.panel6.Name = "panel6";
        this.panel6.Size = new System.Drawing.Size(100, 200);
        this.panel6.TabIndex = 4;
        this.panel6.Click += new System.EventHandler(this.panel6_Click);
        // 
        // panel7
        // 
        this.panel7.BackgroundImage = global::HuaRongDao.Properties.Resources._007;
        this.panel7.Location = new System.Drawing.Point(108, 343);
        this.panel7.Name = "panel7";
        this.panel7.Size = new System.Drawing.Size(100, 100);
        this.panel7.TabIndex = 5;
        this.panel7.Click += new System.EventHandler(this.panel7_Click);
        // 
        // panel8
        // 
        this.panel8.BackgroundImage = global::HuaRongDao.Properties.Resources._008;
        this.panel8.Location = new System.Drawing.Point(208, 343);
        this.panel8.Name = "panel8";
        this.panel8.Size = new System.Drawing.Size(100, 100);
        this.panel8.TabIndex = 6;
        this.panel8.Click += new System.EventHandler(this.panel8_Click);
        // 
        // panel9
        // 
        this.panel9.BackgroundImage = global::HuaRongDao.Properties.Resources._009;
        this.panel9.Location = new System.Drawing.Point(8, 443);
        this.panel9.Name = "panel9";
        this.panel9.Size = new System.Drawing.Size(100, 100);
        this.panel9.TabIndex = 7;
        this.panel9.Click += new System.EventHandler(this.panel9_Click);
        // 
        // panel10
        // 
        this.panel10.BackgroundImage = global::HuaRongDao.Properties.Resources._010;
        this.panel10.Location = new System.Drawing.Point(308, 443);
        this.panel10.Name = "panel10";
        this.panel10.Size = new System.Drawing.Size(100, 100);
        this.panel10.TabIndex = 8;
        this.panel10.Click += new System.EventHandler(this.panel10_Click);
        // 
        // button1
        // 
        this.button1.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
        this.button1.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
        this.button1.ForeColor = System.Drawing.Color.White;
        this.button1.Location = new System.Drawing.Point(11, 9);
        this.button1.Name = "button1";
        this.button1.Size = new System.Drawing.Size(75, 25);
        this.button1.TabIndex = 0;
        this.button1.Text = "新游戏";
        this.button1.UseVisualStyleBackColor = true;
        this.button1.Click += new System.EventHandler(this.button1_Click);
        // 
        // Form1
        // 
        this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
        this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
        this.BackColor = System.Drawing.Color.Teal;
        this.ClientSize = new System.Drawing.Size(413, 550);
        this.Controls.Add(this.button1);
        this.Controls.Add(this.panel10);
        this.Controls.Add(this.panel9);
        this.Controls.Add(this.panel8);
        this.Controls.Add(this.panel7);
        this.Controls.Add(this.panel6);
        this.Controls.Add(this.panel5);
        this.Controls.Add(this.panel4);
        this.Controls.Add(this.panel3);
        this.Controls.Add(this.panel2);
        this.Controls.Add(this.panel1);
        this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
        this.KeyPreview = true;
        this.MaximizeBox = false;
        this.Name = "Form1";
        this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
        this.Text = "华容道";
        this.Load += new System.EventHandler(this.Form1_Load);
        this.KeyUp += new System.Windows.Forms.KeyEventHandler(this.Form1_KeyUp);
        this.ResumeLayout(false);

    }

    #endregion

    private System.Windows.Forms.Panel panel1;
    private System.Windows.Forms.Panel panel2;
    private System.Windows.Forms.Panel panel3;
    private System.Windows.Forms.Panel panel4;
    private System.Windows.Forms.Panel panel5;
    private System.Windows.Forms.Panel panel6;
    private System.Windows.Forms.Panel panel7;
    private System.Windows.Forms.Panel panel8;
    private System.Windows.Forms.Panel panel9;
    private System.Windows.Forms.Panel panel10;
    private System.Windows.Forms.Button button1;
}

需要的再直接Call我下方卡片,直接发。

👉其他

📢作者:小空和小芝中的小空
📢转载说明-务必注明来源:https://zhima.blog.csdn.net/
📢这位道友请留步☁️,我观你气度不凡,谈吐间隐隐有王者霸气💚,日后定有一番大作为📝!!!旁边有点赞👍收藏🌟今日传你,点了吧,未来你成功☀️,我分文不取,若不成功⚡️,也好回来找我。

温馨提示点击下方卡片获取更多意想不到的资源。
空名先生

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/137966.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

Rust个人学习之聊聊Rust的变量

今天看了Rust的变量相关内容&#xff0c;Rust变量很重要的一个设计点是: Rust变量默认是不可变的。 很难理解? 我们接下来一起研究一下Rust的变量&#xff0c; 在Rust中变量是通过关键字let进行声明的 let x 5; 上述语句就是定义了一个名称为x的变量&#xff0c;变量的值为…

修改esp idf hello_world_main.c,验证Strategy 策略基类。出现一个问题,加以解决

修改esp32 idf hello_world_main.c&#xff0c;验证Strategy 策略基类。出现几个问题&#xff0c;加以解决&#xff1a; 错误&#xff1a; …/main/hello_world_main.cpp: In function ‘void test01()’: …/main/hello_world_main.cpp:77:12: error: deleting object of ab…

入门力扣自学笔记228 C++ (题目编号:2042)

2042. 检查句子中的数字是否递增题目&#xff1a;句子是由若干 token 组成的一个列表&#xff0c;token 间用 单个 空格分隔&#xff0c;句子没有前导或尾随空格。每个 token 要么是一个由数字 0-9 组成的不含前导零的 正整数 &#xff0c;要么是一个由小写英文字母组成的 单词…

很好用的gRPC和WebSocket调试工具Apipost!强烈推荐

随着软件开发行业的发展&#xff0c;越来越多的公司和开发人员在工作中会涉及到gRPC和WebSocket等接口类型&#xff0c;但是目前市面上能支持这种接口的调试工具却几乎没有&#xff0c;国外的工具大都晦涩难懂&#xff0c;不符合我们的开发习惯&#xff0c;很难上手使用。 经过…

Android开发——APP ANR治理

一、背景介绍 ANR&#xff08;Application Not Response&#xff09;指应用程序无响应&#xff0c;通常出现在主线程被阻塞时&#xff0c;并伴随ANR弹窗出现。ANR发生时要么关闭当前app&#xff0c;要么等待&#xff0c;等待的结果大概率还是继续ANR&#xff0c;最终需要杀掉应…

在msys2上安装武汉大学的开源PPP解算软件-PRIDE PPP-AR

最近一篇文章《免费提供POSMV的GNSS数据解算服务&#xff0c;验潮仪丢失的一种补救》发表了以后&#xff0c;有一位相识的网友提供了一个重要信息&#xff1a;武汉大学PPP解算软件名字为PRIDE PPP-AR 开源了&#xff0c;其GUI自动下载星历文件进行自主解算。PRIDE PPP-AR 的官网…

2022年中小企业数字化转型路径报告(附下载链接)

省时查报告-专业、及时、全面的行研报告库省时查方案-专业、及时、全面的营销策划方案库【免费下载】2022年11月份热门报告盘点罗振宇2023年跨年演讲PPT原稿吴晓波2022年年终秀演讲PPT原稿2023年&#xff0c;如何科学制定年度规划&#xff1f;《底层逻辑》高清配图清华大学256页…

(机器学习深度学习常用库、框架|Pytorch篇)第三节:Pytorch之torchvision详解

文章目录一&#xff1a;torchvision概述二&#xff1a;torchvision.datasets&#xff08;1&#xff09;官方数据集&#xff08;2&#xff09;自定义数据集类&#xff08;3&#xff09;ImageFolder手动实现三&#xff1a;torchvision.transforms四&#xff1a;torchvision.model…

【元宇宙欧米说】左手追星,右手造富——用Web3加持娱乐行业

娱乐圈如何才能与资本市场保持步调一致&#xff1f;Web3浪潮来袭&#xff0c;文娱行业如何才能踏上Web3世界的巨轮&#xff1f; 1月4日下午三点&#xff0c;VegaIdol联合创始人Linnea将以**“左手追星&#xff0c;右手造富——用Web3加持娱乐行业”为题&#xff0c;与大家共同…

界面组件DevExpress WinForms v22.2 -全新升级的皮肤和矢量图标

DevExpress WinForms拥有180组件和UI库&#xff0c;能为Windows Forms平台创建具有影响力的业务解决方案。DevExpress WinForms能完美构建流畅、美观且易于使用的应用程序&#xff0c;无论是Office风格的界面&#xff0c;还是分析处理大批量的业务数据&#xff0c;它都能轻松胜…

RabbitMQ的简单介绍与使用

前言&#xff1a;大家好&#xff0c;我是小威&#xff0c;24届毕业生&#xff0c;曾经在某央企公司实习&#xff0c;目前入职某税务公司。本篇文章将记录和分享RabbitMQ相关的知识点。 本篇文章记录的基础知识&#xff0c;适合在学Java的小白&#xff0c;也适合复习中&#xff…

乐视宣布每周工作4天半

老板跑了&#xff0c;公司不但没倒&#xff0c;而且员工还过上了不加班不内卷的神仙生活。 典型的老虎不在家&#xff0c;规矩自己定啊&#xff01; 神仙日子 前段时间&#xff0c;网上流传着一则消息&#xff0c;说乐视目前还有400多名员工&#xff0c;靠着《甄嬛传》版权和…

Cadence PCB仿真使用Allegro PCB SI 创建含差分对网络元器件的IBIS模型图文教程

⏪《上一篇》   🏡《总目录》   ⏩《下一篇》 1,概述 本文简单介绍使用Allegro PCB SI软件为BRD PCB设计文件中的含有差分对网络的元器件创建IBIS模型的方法。 2,创建方法 第1步:确定打开PCB文件的软件是 Allegro PCB SI 如果不是Allegro PCB SI,可执行File→Chan…

回望2022,依然值得仰望星空

转眼间 2022 年已经过去&#xff0c;这是我在 CSDN 创作的第二年&#xff0c;在文章的创作上也是脱离“博客新手”身份&#xff0c;正式蜕变为“博客老手”的一年&#xff0c;各方面收获颇丰。2021 初见 CSDN来到 CSDN 是在 2020 年的 11 月份&#xff0c;但是那时候并没有开始…

传感器与传感器通道

传感器 Def:以一定精确度 把 被测量转换为与之有确定对应关系的&#xff0c;便于应用的某种物理量的测量系统。 作用&#xff1a; 捕获并转换信息&#xff0c;非电量物理参数转换为电参数。 e.g: 速度 ->电压&#xff0c;电流 组成&#xff1a; 敏感元件&#xff08;直接感受…

css移动端适配最佳实践

移动端适配&#xff0c;在移动端里经常有遇到&#xff0c;在不同分辨率移动端设备精确还原UI设计稿&#xff0c;这是一个令人抓狂的问题&#xff0c;好在有flex&#xff0c;box布局解决了自适应很大一部分问题。 在开始本文之前主要介绍几种笔者常用的适配方案 1、设置meta标…

美赛Day1

1 层次分析法 评价类问题 1.1 模型介绍 1.1.1 模型介绍 在对B的评价中&#xff0c;判断A个物体哪个最好。将B分为k个可以评价的方面分别进行打分&#xff08;每个方面A个物体的分数和为1&#xff09;&#xff0c;最终对A个物体的k个方面加权求和进行比较。 1.1.2 解题思路…

剑指政企数智办公市场,通信厂商融云有何看家本领?

近年来&#xff0c;数字经济正在加速赋能千行百业&#xff0c;我国的政务办公也正加速由数字化向智能化深度扩展。在线办公市场从公有云到政企私有云的热度&#xff0c;已然节节攀升。近日&#xff0c;作为通信厂商被熟知的融云推出了“百幄”数智办公平台&#xff0c;正式宣布…

05数据结构——顺序表与链表

开始系统学习算法啦&#xff01;为后面力扣和蓝桥杯的刷题做准备&#xff01;这个专栏将记录自己学习算法是的笔记&#xff0c;包括概念&#xff0c;算法运行过程&#xff0c;以及代码实现&#xff0c;希望能给大家带来帮助&#xff0c;感兴趣的小伙伴欢迎评论区留言或者私信博…

【DETR】DETR训练VOC数据集/自定义数据集

训练DETR一、数据准备二、配置DETRReferences一、数据准备 DETR用的是COCO格式的数据集。 如果要用DETR训练自己的数据集&#xff0c;直接利用Labelimg标注成COCO格式。 如果是VOC数据集的话&#xff0c;要做一个格式转换。网上一大堆格式转换的代码都很乱&#xff0c;所以自己…