资源简介
C#模拟电梯控制,有源码,清楚易懂,实用。
代码片段和文件信息
using System;
using System.Collections.Generic;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
//Download by http://www.codefans.net
namespace lift
{
public partial class Form1 : Form
{
int destion = 0;//目的楼层
int number = 0;//所到楼层
public Form1()
{
InitializeComponent();
//this.skinEngine1.SkinFile = “Vista2_color5.ssk“;
}
private void button21_Click(object sender EventArgs e)
{
if (destion == 0)
{
lblWarming.Visible = true;
}
else
{
tmrSeconds.Start();
}
}
private void lift_click(object sender EventArgs e)
{
if (destion == 0)
{
destion = Convert.ToInt32(((Button)sender).Tag);
((Button)sender).BackColor = Color.Red;
}
else
{
MessageBox.Show(“你只能选择一个楼层““提示“MessageBoxButtons.OKMessageBoxIcon.Information);
}
}
private void FormmoveUp()
{
bool x = false;
bool y = true;
if (x == false && y == true)
{
this.Top-=30;
if (this.Top==-319)
{
this.Top = 450;
}
}
}
private void FormmoveDown()
{
bool x = false;
bool y = true;
if (x == false && y == true)
{
this.Top+=30;
if(this.Top==780)
{
this.Top = 0;
}
}
}
private void tmrSeconds_Tick(object sender EventArgs e)
{
if (number < destion)
{
FormmoveUp();
number++;
foreach (Control item in this.Controls)
{
if (item is Button)
{
if(number<=destion)
{
item.BackColor = Color.LightGray;
}
int index = Convert.ToInt32(item.Tag);
if (index == number)
{
item.BackColor = Color.Green;
}
}
}
lblPostion.Text = number.ToString();
}
else if(number>destion)
{
FormmoveDown();
number--;
foreach (Control item in this.Controls)
{
if (item is Button)
{
if (number >= destion)
{
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 901 2008-12-18 19:49 C#模拟电梯控制\lift.sln
..A..H. 17920 2009-08-06 12:19 C#模拟电梯控制\lift.suo
文件 4227 2009-07-01 07:38 C#模拟电梯控制\lift\Form1.cs
文件 20177 2009-06-14 18:24 C#模拟电梯控制\lift\Form1.Designer.cs
文件 51403 2009-06-14 18:24 C#模拟电梯控制\lift\Form1.resx
文件 4448 2009-06-14 15:49 C#模拟电梯控制\lift\lift.csproj
文件 29926 2009-06-14 15:49 C#模拟电梯控制\lift\Mac OS X Modern Icon 13.ico
文件 500 2009-07-01 07:38 C#模拟电梯控制\lift\Program.cs
文件 2774 2008-12-19 21:26 C#模拟电梯控制\lift\Resources\1.bmp
文件 1228 2009-07-01 07:38 C#模拟电梯控制\lift\Properties\AssemblyInfo.cs
文件 3109 2009-07-01 07:38 C#模拟电梯控制\lift\Properties\Resources.Designer.cs
文件 6189 2008-12-19 21:26 C#模拟电梯控制\lift\Properties\Resources.resx
文件 1087 2008-12-18 19:49 C#模拟电梯控制\lift\Properties\Settings.Designer.cs
文件 249 2008-12-18 19:49 C#模拟电梯控制\lift\Properties\Settings.settings
文件 516096 2006-08-18 11:50 C#模拟电梯控制\lift\bin\Debug\IrisSkin2.dll
文件 15821 2006-07-18 23:12 C#模拟电梯控制\lift\bin\Debug\Vista2_color5.ssk
文件 5632 2005-12-08 14:51 C#模拟电梯控制\lift\bin\Debug\lift.vshost.exe
文件 90112 2009-08-06 11:29 C#模拟电梯控制\lift\bin\Debug\lift.exe
文件 30208 2009-08-06 11:29 C#模拟电梯控制\lift\bin\Debug\lift.pdb
文件 496 2009-07-29 17:23 C#模拟电梯控制\lift\obj\Debug\lift.csproj.ResolveComReference.cache
文件 30492 2009-08-06 11:29 C#模拟电梯控制\lift\obj\Debug\lift.Form1.resources
文件 3236 2009-08-06 11:29 C#模拟电梯控制\lift\obj\Debug\lift.Properties.Resources.resources
文件 877 2009-07-29 17:23 C#模拟电梯控制\lift\obj\Debug\lift.csproj.GenerateResource.Cache
文件 30208 2009-08-06 11:29 C#模拟电梯控制\lift\obj\Debug\lift.pdb
文件 90112 2009-08-06 11:29 C#模拟电梯控制\lift\obj\Debug\lift.exe
文件 24155 2009-08-06 11:29 C#模拟电梯控制\lift\obj\Debug\ResolveAssemblyReference.cache
文件 296 2009-08-06 11:50 C#模拟电梯控制\lift\obj\lift.csproj.FileList.txt
目录 0 2009-07-29 17:23 C#模拟电梯控制\lift\obj\Debug\TempPE
目录 0 2009-07-29 16:51 C#模拟电梯控制\lift\bin\Debug
目录 0 2009-07-29 17:23 C#模拟电梯控制\lift\obj\Debug
............此处省略9个文件信息
- 上一篇:C#节点的使用.zip
- 下一篇:国密算法SM2、SM3、SM4的C#源码
相关资源
- 智慧城市 智能家居 C# 源代码
- c#获取mobile手机的IMEI和IMSI
- C#实现简单QQ聊天程序
- 操作系统 模拟的 欢迎下载 C#版
- C#写的计算机性能监控程序
- 用C#实现邮件发送,有点类似于outlo
- MVC model层代码生成器 C#
- c#小型图书销售系统
- C# Socket Server Client 通讯应用 完整的服
- c# winform 自动登录 百度账户 源代码
- C#编写的16进制计算器
- C#TCP通信协议
- C# 数据表(Dataset)操作 合并 查询一
- C#语音识别系统speechsdk51,SpeechSDK51L
- 数据库备份还原工具1.0 C# 源码
-
[免费]xm
lDocument 节点遍历C# - EQ2008LEDc#开发实例
- DirectX.Capturec# winform 操作摄像头录像附
- c# 实现的最大最小距离方法对鸢尾花
- C#版保龄球记分代码
- C#自定义控件
- 基于c#的实验室设备管理系统621530
- C# 使用ListView控件实现图片浏览器(源
- C#简单窗体聊天程序
- C#指纹识别系统程序 报告
- c# 高校档案信息管理系统
- c#向word文件插入图片
- C#左侧导航菜单(动态生成)
- C#TCP 通信(TCP发送16进制)
- C# sql实现批量导入数据到数据库
评论
共有 条评论