?? nlsfk.cs
字號:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
namespace Employee
{
/// <summary>
/// nlsfk 的摘要說明。
/// </summary>
public class nlsfk : System.Windows.Forms.Form
{
private System.Windows.Forms.Panel screenPanel;
private System.Windows.Forms.Panel nextPanel;
private System.Windows.Forms.Timer timer;
private System.Windows.Forms.MainMenu mainMenu;
private System.Windows.Forms.MenuItem menuItem4;
private System.Windows.Forms.MenuItem gameMenu;
private System.Windows.Forms.MenuItem startMenu;
private System.Windows.Forms.MenuItem stopMenu;
private System.Windows.Forms.MenuItem exitMenu;
private System.Windows.Forms.MenuItem helpMenu;
private System.Windows.Forms.MenuItem aboutMenu;
private System.ComponentModel.IContainer components;
private Random rndShape = new Random();
private Shape nextShape;
private Body mainBody = new Body();
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 speedLabel;
private System.Windows.Forms.Label scoreLabel;
private GAME_STATUS gameStatus;
private int speed;
private int score;
private System.Windows.Forms.Label linesLabel;
private System.Windows.Forms.PictureBox pictureBox1;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.PictureBox pictureBox2;
private System.Windows.Forms.PictureBox pictureBox3;
private System.Windows.Forms.PictureBox pictureBox4;
private System.Windows.Forms.PictureBox pictureBox5;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.Label label7;
private System.Windows.Forms.Label label8;
private System.Windows.Forms.Label label9;
private int lines;
enum GAME_STATUS {GAME_STOP, GAME_RUN, GAME_OVER};
public nlsfk()
{
//
// Windows 窗體設計器支持所必需的
//
InitializeComponent();
//
// TODO: 在 InitializeComponent 調用后添加任何構造函數代碼
//
Shape.InitTetrisDefine();
}
/// <summary>
/// 清理所有正在使用的資源。
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Windows Form Designer generated code
/// <summary>
/// 設計器支持所需的方法 - 不要使用代碼編輯器修改
/// 此方法的內容。
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(nlsfk));
this.screenPanel = new System.Windows.Forms.Panel();
this.nextPanel = new System.Windows.Forms.Panel();
this.timer = new System.Windows.Forms.Timer(this.components);
this.mainMenu = new System.Windows.Forms.MainMenu();
this.gameMenu = new System.Windows.Forms.MenuItem();
this.startMenu = new System.Windows.Forms.MenuItem();
this.stopMenu = new System.Windows.Forms.MenuItem();
this.menuItem4 = new System.Windows.Forms.MenuItem();
this.exitMenu = new System.Windows.Forms.MenuItem();
this.helpMenu = new System.Windows.Forms.MenuItem();
this.aboutMenu = new System.Windows.Forms.MenuItem();
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label();
this.speedLabel = new System.Windows.Forms.Label();
this.linesLabel = new System.Windows.Forms.Label();
this.scoreLabel = new System.Windows.Forms.Label();
this.pictureBox1 = new System.Windows.Forms.PictureBox();
this.label5 = new System.Windows.Forms.Label();
this.pictureBox2 = new System.Windows.Forms.PictureBox();
this.pictureBox3 = new System.Windows.Forms.PictureBox();
this.pictureBox4 = new System.Windows.Forms.PictureBox();
this.pictureBox5 = new System.Windows.Forms.PictureBox();
this.label6 = new System.Windows.Forms.Label();
this.label7 = new System.Windows.Forms.Label();
this.label8 = new System.Windows.Forms.Label();
this.label9 = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// screenPanel
//
this.screenPanel.BackColor = System.Drawing.Color.White;
this.screenPanel.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
this.screenPanel.Dock = System.Windows.Forms.DockStyle.Left;
this.screenPanel.Location = new System.Drawing.Point(0, 0);
this.screenPanel.Name = "screenPanel";
this.screenPanel.Size = new System.Drawing.Size(206, 305);
this.screenPanel.TabIndex = 0;
//
// nextPanel
//
this.nextPanel.BackColor = System.Drawing.Color.White;
this.nextPanel.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
this.nextPanel.Location = new System.Drawing.Point(280, 0);
this.nextPanel.Name = "nextPanel";
this.nextPanel.Size = new System.Drawing.Size(104, 96);
this.nextPanel.TabIndex = 1;
//
// timer
//
this.timer.Interval = 300;
this.timer.Tick += new System.EventHandler(this.OnTimer);
//
// mainMenu
//
this.mainMenu.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
this.gameMenu,
this.helpMenu});
//
// gameMenu
//
this.gameMenu.Index = 0;
this.gameMenu.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
this.startMenu,
this.stopMenu,
this.menuItem4,
this.exitMenu});
this.gameMenu.Text = "文件";
//
// startMenu
//
this.startMenu.Index = 0;
this.startMenu.Text = "開始";
this.startMenu.Click += new System.EventHandler(this.startMenu_Click);
//
// stopMenu
//
this.stopMenu.Enabled = false;
this.stopMenu.Index = 1;
this.stopMenu.Text = "停止";
this.stopMenu.Click += new System.EventHandler(this.stopMenu_Click);
//
// menuItem4
//
this.menuItem4.Index = 2;
this.menuItem4.Text = "-";
//
// exitMenu
//
this.exitMenu.Index = 3;
this.exitMenu.Text = "退出";
this.exitMenu.Click += new System.EventHandler(this.exitMenu_Click);
//
// helpMenu
//
this.helpMenu.Index = 1;
this.helpMenu.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {
this.aboutMenu});
this.helpMenu.Text = "幫助";
//
// aboutMenu
//
this.aboutMenu.Index = 0;
this.aboutMenu.Text = "關于";
this.aboutMenu.Click += new System.EventHandler(this.aboutMenu_Click);
//
// label1
//
this.label1.Location = new System.Drawing.Point(216, 8);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(56, 16);
this.label1.TabIndex = 2;
this.label1.Text = "下一個:";
//
// label2
//
this.label2.Location = new System.Drawing.Point(216, 115);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(56, 16);
this.label2.TabIndex = 3;
this.label2.Text = "分 數:";
//
// label3
//
this.label3.Location = new System.Drawing.Point(216, 139);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(56, 16);
this.label3.TabIndex = 4;
this.label3.Text = "行 數:";
//
// label4
//
this.label4.Location = new System.Drawing.Point(216, 163);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(56, 16);
this.label4.TabIndex = 5;
this.label4.Text = "速 度:";
//
// speedLabel
//
this.speedLabel.Location = new System.Drawing.Point(288, 163);
this.speedLabel.Name = "speedLabel";
this.speedLabel.Size = new System.Drawing.Size(56, 16);
this.speedLabel.TabIndex = 8;
this.speedLabel.Text = "0";
//
// linesLabel
//
this.linesLabel.Location = new System.Drawing.Point(288, 139);
this.linesLabel.Name = "linesLabel";
this.linesLabel.Size = new System.Drawing.Size(56, 16);
this.linesLabel.TabIndex = 7;
this.linesLabel.Text = "0";
//
// scoreLabel
//
this.scoreLabel.Location = new System.Drawing.Point(288, 115);
this.scoreLabel.Name = "scoreLabel";
this.scoreLabel.Size = new System.Drawing.Size(56, 16);
this.scoreLabel.TabIndex = 6;
this.scoreLabel.Text = "0";
//
// pictureBox1
//
this.pictureBox1.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox1.Image")));
this.pictureBox1.Location = new System.Drawing.Point(275, 195);
this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.Size = new System.Drawing.Size(110, 105);
this.pictureBox1.TabIndex = 9;
this.pictureBox1.TabStop = false;
//
// label5
//
this.label5.ForeColor = System.Drawing.Color.Fuchsia;
this.label5.Location = new System.Drawing.Point(208, 187);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(54, 16);
this.label5.TabIndex = 10;
this.label5.Text = "達也提醒";
this.label5.TextAlign = System.Drawing.ContentAlignment.BottomLeft;
//
// pictureBox2
//
this.pictureBox2.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox2.Image")));
this.pictureBox2.Location = new System.Drawing.Point(208, 208);
this.pictureBox2.Name = "pictureBox2";
this.pictureBox2.Size = new System.Drawing.Size(22, 22);
this.pictureBox2.TabIndex = 11;
this.pictureBox2.TabStop = false;
//
// pictureBox3
//
this.pictureBox3.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox3.Image")));
this.pictureBox3.Location = new System.Drawing.Point(208, 230);
this.pictureBox3.Name = "pictureBox3";
this.pictureBox3.Size = new System.Drawing.Size(22, 22);
this.pictureBox3.TabIndex = 12;
this.pictureBox3.TabStop = false;
//
// pictureBox4
//
this.pictureBox4.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox4.Image")));
this.pictureBox4.Location = new System.Drawing.Point(208, 252);
this.pictureBox4.Name = "pictureBox4";
this.pictureBox4.Size = new System.Drawing.Size(22, 22);
this.pictureBox4.TabIndex = 13;
this.pictureBox4.TabStop = false;
//
// pictureBox5
//
this.pictureBox5.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox5.Image")));
this.pictureBox5.Location = new System.Drawing.Point(208, 274);
this.pictureBox5.Name = "pictureBox5";
this.pictureBox5.Size = new System.Drawing.Size(22, 22);
this.pictureBox5.TabIndex = 14;
this.pictureBox5.TabStop = false;
//
// label6
//
this.label6.ForeColor = System.Drawing.Color.Fuchsia;
this.label6.Location = new System.Drawing.Point(235, 208);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(30, 22);
this.label6.TabIndex = 15;
this.label6.Text = "左移";
this.label6.TextAlign = System.Drawing.ContentAlignment.BottomLeft;
//
// label7
//
this.label7.ForeColor = System.Drawing.Color.Fuchsia;
this.label7.Location = new System.Drawing.Point(235, 230);
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -