資源簡介
C#十字路口紅綠燈模擬,利用timer控件完成

代碼片段和文件信息
using?System;
using?System.Collections.Generic;
using?System.ComponentModel;
using?System.Data;
using?System.Drawing;
using?System.Linq;
using?System.Text;
using?System.Windows.Forms;
namespace?WindowsFormsApplication1
{
????public?partial?class?Form1?:?Form
????{
????????bool?NS?=?false?WE?=?false;?int?click?=?0;
????????public?Form1()
????????{
????????????InitializeComponent();
????????}
????????private?void?Form1_Load(object?sender?EventArgs?e)
????????{
????????}
????????private?void?pictureBox1_Click(object?sender?EventArgs?e)
????????{
????????}
????????private?void?button1_Click(object?sender?EventArgs?e)
????????{
????????????NS?=?true;
????????????Ngreen.Visible?=?true;
????????????Sgreen.Visible?=?true;
????????????Wred.Visible?=?true;
????????????Ered.Visible?=?true;
????????}
????????private?void?button2_Click(object?sender?EventArgs?e)
????????{
????????????NS?=?false;?WE?=?false;
????????????Ngreen.Visible?=?false;
????????????Nred.Visible?=?false;
????????????Nyellow.Visible?=?false;
????????????Sgreen.Visible?=?false;
????????????Sred.Visible?=?false;
????????????Syellow.Visible?=?false;
????????????Egreen.Visible?=?false;
????????????Ered.Visible?=?false;
????????????Eyellow.Visible?=?false;
????????????Wgreen.Visible?=?false;
????????????Wred.Visible?=?false;
????????????Wyellow.Visible?=?false;
????????}
????????private?void?pictureBox8_Click(object?sender?EventArgs?e)
????????{
????????}
????????private?void?button4_Click(object?sender?EventArgs?e)
????????{
????????????if?(WE?==?true)
????????????{
????????????????NS?=?true;?WE?=?false;
????????????????Wgreen.Visible?=?false;
????????????????Egreen.Visible?=?false;
????????????????Eyellow.Visible?=?true;
????????????????Wyellow.Visible?=?true;
????????????????timer1.Enabled?=?true;
????????????????Eyellow.Visible?=?false;
????????????????Wyellow.Visible?=?false;
????????????????Ngreen.Visible?=?true;
????????????????Sgreen.Visible?=?true;
????????????????Wred.Visible?=?true;
????????????????Ered.Visible?=?true;
????????????????Nred.Visible?=?false;
????????????????Sred.Visible?=?false;
????????????}
????????????else
????????????{
????????????????MessageBox.Show(“當前不能切換“);
????????????}
????????}
????????private?void?button5_Click(object?sender?EventArgs?e)
????????{
????????????if?(NS?==?true)
????????????{
????????????????NS?=?false;?WE?=?true;
????????????????Ngreen.Visible?=?false;
????????????????Sgreen.Visible?=?false;
????????????????Syellow.Visible?=?true;
????????????????Nyellow.Visible?=?true;
????????????????timer1.Enabled?=?true;
????????????????Syellow.Visible?=?false;
????????????????Nyellow.Visible?=?false;
????????????????Egreen.Visible?=?true;
????????????????Wgreen.Visible?=?true;
????????????????Nred.Visible?=?true;
????????????????Sred.Visible?=?true;
????????????????Ered.Visible?=?false;
????????????????Wred.Visible?=?false;
??????????
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2014-04-03?07:52??十字路口模擬\
?????目錄???????????0??2014-04-03?07:52??十字路口模擬\WindowsFormsApplication1\
?????目錄???????????0??2014-04-03?07:52??十字路口模擬\WindowsFormsApplication1\WindowsFormsApplication1\
?????文件?????????914??2014-04-02?19:57??十字路口模擬\WindowsFormsApplication1\WindowsFormsApplication1.sln
?????文件???????18432??2014-04-02?20:54??十字路口模擬\WindowsFormsApplication1\WindowsFormsApplication1.suo
?????目錄???????????0??2014-04-03?07:52??十字路口模擬\WindowsFormsApplication1\WindowsFormsApplication1\bin\
?????目錄???????????0??2014-04-03?07:52??十字路口模擬\WindowsFormsApplication1\WindowsFormsApplication1\bin\Debug\
?????文件??????384512??2014-04-02?21:19??十字路口模擬\WindowsFormsApplication1\WindowsFormsApplication1\bin\Debug\WindowsFormsApplication1.exe
?????文件???????30208??2014-04-02?21:19??十字路口模擬\WindowsFormsApplication1\WindowsFormsApplication1\bin\Debug\WindowsFormsApplication1.pdb
?????文件???????11600??2014-04-02?21:19??十字路口模擬\WindowsFormsApplication1\WindowsFormsApplication1\bin\Debug\WindowsFormsApplication1.vshost.exe
?????文件?????????490??2010-03-17?22:39??十字路口模擬\WindowsFormsApplication1\WindowsFormsApplication1\bin\Debug\WindowsFormsApplication1.vshost.exe.manifest
?????文件????????3386??2014-04-02?21:20??十字路口模擬\WindowsFormsApplication1\WindowsFormsApplication1\Form1.cs
?????文件???????17006??2014-04-02?21:19??十字路口模擬\WindowsFormsApplication1\WindowsFormsApplication1\Form1.Designer.cs
?????文件??????558840??2014-04-02?21:19??十字路口模擬\WindowsFormsApplication1\WindowsFormsApplication1\Form1.resx
?????目錄???????????0??2014-04-03?07:52??十字路口模擬\WindowsFormsApplication1\WindowsFormsApplication1\obj\
?????目錄???????????0??2014-04-03?07:52??十字路口模擬\WindowsFormsApplication1\WindowsFormsApplication1\obj\x86\
?????目錄???????????0??2014-04-03?07:52??十字路口模擬\WindowsFormsApplication1\WindowsFormsApplication1\obj\x86\Debug\
?????文件????????5420??2014-04-02?20:13??十字路口模擬\WindowsFormsApplication1\WindowsFormsApplication1\obj\x86\Debug\DesignTimeResolveAssemblyReferences.cache
?????文件????????6426??2014-04-02?21:19??十字路口模擬\WindowsFormsApplication1\WindowsFormsApplication1\obj\x86\Debug\DesignTimeResolveAssemblyReferencesInput.cache
?????目錄???????????0??2014-04-02?19:57??十字路口模擬\WindowsFormsApplication1\WindowsFormsApplication1\obj\x86\Debug\TempPE\
?????文件????????1074??2014-04-02?21:19??十字路口模擬\WindowsFormsApplication1\WindowsFormsApplication1\obj\x86\Debug\WindowsFormsApplication1.csproj.FileListAbsolute.txt
?????文件?????????975??2014-04-02?21:19??十字路口模擬\WindowsFormsApplication1\WindowsFormsApplication1\obj\x86\Debug\WindowsFormsApplication1.csproj.GenerateResource.Cache
?????文件????????9214??2014-04-02?20:29??十字路口模擬\WindowsFormsApplication1\WindowsFormsApplication1\obj\x86\Debug\WindowsFormsApplication1.csprojResolveAssemblyReference.cache
?????文件??????384512??2014-04-02?21:19??十字路口模擬\WindowsFormsApplication1\WindowsFormsApplication1\obj\x86\Debug\WindowsFormsApplication1.exe
?????文件??????369787??2014-04-02?21:19??十字路口模擬\WindowsFormsApplication1\WindowsFormsApplication1\obj\x86\Debug\WindowsFormsApplication1.Form1.resources
?????文件???????30208??2014-04-02?21:19??十字路口模擬\WindowsFormsApplication1\WindowsFormsApplication1\obj\x86\Debug\WindowsFormsApplication1.pdb
?????文件?????????180??2014-04-02?20:29??十字路口模擬\WindowsFormsApplication1\WindowsFormsApplication1\obj\x86\Debug\WindowsFormsApplication1.Properties.Resources.resources
?????文件?????????505??2014-04-02?19:57??十字路口模擬\WindowsFormsApplication1\WindowsFormsApplication1\Program.cs
?????目錄???????????0??2014-04-03?07:52??十字路口模擬\WindowsFormsApplication1\WindowsFormsApplication1\Properties\
?????文件????????1398??2014-04-02?19:57??十字路口模擬\WindowsFormsApplication1\WindowsFormsApplication1\Properties\AssemblyInfo.cs
?????文件????????2900??2014-04-02?19:57??十字路口模擬\WindowsFormsApplication1\WindowsFormsApplication1\Properties\Resources.Designer.cs
............此處省略8個文件信息
- 上一篇:簡易c#學生成績管理系統
- 下一篇:C#自定義控件庫
評論
共有 條評論