资源简介
适合C#初学者使用,参考学习的俄罗斯方块源程序。已成功调试,适合新手拿来练习。
代码片段和文件信息
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Diagnostics;
using youxi;
using System.IO;
namespace youxiApp
{
public partial class Form1 : Form
{
private youxiControl youxiControl = new youxiControl();
private youxiNext youxiNext = new youxiNext();
private youxiScore youxiScore = new youxiScore();
public Form1()
{
InitializeComponent();
youxiControl.Top = menuStripMain.Height + 2;
youxiControl.Left = 2;
youxiControl.Parent = this;
youxiControl.ImageList = imageList1;
youxiNext.Parent = this;
youxiNext.Top = youxiControl.Top;
youxiNext.Left = youxiControl.Left + youxiControl.Width + 4;
youxiControl.TetrisNext = youxiNext;
youxiScore.Parent = this;
youxiScore.Top = youxiNext.Top + youxiNext.Height + 4;
youxiScore.Left = youxiNext.Left;
youxiControl.TetrisScore = youxiScore;
style1ToolStripMenuItem.Image = imageList1.Images[0];
style2ToolStripMenuItem.Image = imageList2.Images[0];
style3ToolStripMenuItem.Image = imageList3.Images[0];
youxiControl.ProgressBar = progressBarReview;
openFileDialog1.FileName = Path.GetDirectoryName(Application.ExecutablePath) +
@“\sample.trf“;
saveFileDialog1.FileName = Path.GetDirectoryName(Application.ExecutablePath) +
@“\sample.trf“;
}
private void buttonReplay_Click(object sender EventArgs e)
{
youxiControl.Replay(true false);
}
private void buttonReview_Click(object sender EventArgs e)
{
youxiControl.Review();
}
private void trackBar1_Scroll(object sender EventArgs e)
{
youxiControl.ReviewSpeed = trackBarReviewSpeed.Value;
}
private void buttonSave_Click(object sender EventArgs e)
{
if (saveFileDialog1.ShowDialog() != DialogResult.OK) return;
if (Path.GetExtension(saveFileDialog1.FileName) == string.Empty)
saveFileDialog1.FileName =
Path.ChangeExtension(saveFileDialog1.FileName “.trf“);
youxiControl.SaveToFile(saveFileDialog1.FileName);
}
private void buttonload_Click(object sender EventArgs e)
{
if (openFileDialog1.ShowDialog() != DialogResult.OK) return;
if (!File.Exists(openFileDialog1.FileName)) return;
youxiControl.LoadFromFile(openFileDialog1.FileName);
}
private void replayToolStripMenuItem_Click(object sender EventArgs e)
{
buttonReplay_Click(buttonReplay new EventArgs())
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
..A..H. 74240 2018-10-01 16:42 俄罗斯方块-C#\.vs\youxi\v15\.suo
文件 0 2018-09-29 15:45 俄罗斯方块-C#\.vs\youxi\v15\Server\sqlite3\db.lock
文件 487424 2018-10-01 16:42 俄罗斯方块-C#\.vs\youxi\v15\Server\sqlite3\storage.ide
文件 5107 2008-04-26 15:27 俄罗斯方块-C#\Backup\TetrisApp\Form1.cs
文件 19971 2008-04-26 15:27 俄罗斯方块-C#\Backup\TetrisApp\Form1.Designer.cs
文件 69947 2008-04-26 15:27 俄罗斯方块-C#\Backup\TetrisApp\Form1.resx
文件 467 2008-04-25 16:12 俄罗斯方块-C#\Backup\TetrisApp\Program.cs
文件 1176 2008-04-25 16:12 俄罗斯方块-C#\Backup\TetrisApp\Properties\AssemblyInfo.cs
文件 2838 2008-04-25 16:12 俄罗斯方块-C#\Backup\TetrisApp\Properties\Resources.Designer.cs
文件 5817 2007-03-25 12:08 俄罗斯方块-C#\Backup\TetrisApp\Properties\Resources.resx
文件 1091 2008-04-25 16:12 俄罗斯方块-C#\Backup\TetrisApp\Properties\Settings.Designer.cs
文件 249 2007-03-21 23:40 俄罗斯方块-C#\Backup\TetrisApp\Properties\Settings.settings
文件 51885 2008-04-26 15:26 俄罗斯方块-C#\Backup\TetrisApp\you.cs
文件 3414 2008-04-25 16:18 俄罗斯方块-C#\Backup\TetrisApp\youxi.csproj
文件 908 2008-04-25 15:57 俄罗斯方块-C#\Backup\youxi.sln
文件 32256 2011-05-26 10:03 俄罗斯方块-C#\Backup\youxi.v12.suo
文件 3251 2007-03-26 10:30 俄罗斯方块-C#\TetrisApp\bin\Debug\sample.trf
文件 77312 2018-09-29 15:46 俄罗斯方块-C#\TetrisApp\bin\Debug\TetrisApp.exe
文件 62976 2018-09-29 15:46 俄罗斯方块-C#\TetrisApp\bin\Debug\TetrisApp.pdb
文件 22704 2014-10-16 10:54 俄罗斯方块-C#\TetrisApp\bin\Debug\TetrisApp.vshost.exe
文件 490 2010-03-17 22:39 俄罗斯方块-C#\TetrisApp\bin\Debug\TetrisApp.vshost.exe.manifest
文件 90112 2008-04-25 16:09 俄罗斯方块-C#\TetrisApp\bin\Debug\youxiApp.exe
文件 5632 2005-12-08 14:51 俄罗斯方块-C#\TetrisApp\bin\Debug\youxiApp.vshost.exe
文件 5107 2014-08-14 15:55 俄罗斯方块-C#\TetrisApp\Form1.cs
文件 19971 2014-08-14 15:55 俄罗斯方块-C#\TetrisApp\Form1.Designer.cs
文件 69947 2014-08-14 15:55 俄罗斯方块-C#\TetrisApp\Form1.resx
文件 1230 2018-10-01 10:34 俄罗斯方块-C#\TetrisApp\obj\Debug\DesignTimeResolveAssemblyReferences.cache
文件 6082 2018-09-29 15:45 俄罗斯方块-C#\TetrisApp\obj\Debug\DesignTimeResolveAssemblyReferencesInput.cache
文件 4031 2007-03-22 12:09 俄罗斯方块-C#\TetrisApp\obj\Debug\ResolveAssemblyReference.cache
文件 4608 2014-08-14 15:48 俄罗斯方块-C#\TetrisApp\obj\Debug\TempPE\Properties.Resources.Designer.cs.dll
............此处省略48个文件信息
- 上一篇:简单人事管理系统
- 下一篇:C#封装MySql数据库操作,反射动态生成SQL语句
相关资源
- C#封装MySql数据库操作,反射动态生成
- 简单人事管理系统
- C#+SQL Server的简单银行管理系统
- C#图书管理系统增 删 改 查 功能都有
- C# 考试管理系统
- c#实现K均值聚类算法,使用mysql数据库
- ArcEngine+C#缓冲区分析(GP工具+ITopolo
- C#版protobuf如何实现http方式二进制传输
- c# 制作的加强型音乐播放器实现了音
- C#版海康客户端API封装
- C#绘制实时曲线,可放大局部图像
- c#读取txt文档中的代码源程序
- C#从现象到本质,随书源码。
- 简易的答题系统
- PCA主成分分析winform实现
- C# Winform Sockets收发Json样例
- C#串口通信工具源代码
- 自写C#蜘蛛爬虫源代码
- USB检测,移除|UsbEject
- 基于ASP.NET SQL2008的在线考试系统源代
- C#.kgtemp转换.mp3文件源码请勿商用
- C#校园卡信息管理系统
- ASP.NET C# 教师工作量管理系统 代码 论
- 基于c#的层次分析法
- C#实现歌词显示.LRC歌词
- C# 层次分析法
- 8 基于两步移动搜索法的可达性分析
- 基于MapX的二次开发
- c# 上位机 数据波形显示 程序
- C# 先检测出指定磁盘的容量,然后根
评论
共有 条评论