3月10日,7:00~9:30 界面设计
3月11日 19:00-21:00
经过讨论,又重新设计一下界面,把电梯上下楼标志由radioButton改为了一个按钮,由按钮来运动。并且把类和主要的函数构思了一下,初步结果如下(看起来很简单,其实。。。恩):
乘客类;
{
体重;
乘客当前楼层;
所要到达楼层;
选择楼层;
控制电梯门开关;
按钮选择上下楼;
}
电梯类
{
电梯号:
电梯当前所在楼层;
电梯状态;
上下楼;
}
只是大概想想思路,具体的就期待明天的19:00—21:00咯偶哈!!!!收工喽!!!!!
3月12日
思路改了,没有用类和接口,用的控件和一些算法
实现了乘客告诉电梯他在哪个楼层,然后电梯到达那个楼层,并且电梯内部的显示屏上显示实时的楼层数。当然还有开关门功能。
3月13日
实现了乘客进到电梯里,按下所要到达的楼层键,电梯可以把乘客准确送到。
还有一个很大的问题就是:当电梯送乘客上楼时,如果有另外的乘客想要上楼,按下这位乘客当前的楼层,电梯就会立即响应这位乘客,而第一位乘客此时还没有到达目的地、、、、
计划未来三个晚上解决掉这个问题!
程序代码:
Form1.cs
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 { public Form1() { InitializeComponent(); } private void button2_Click(object sender, EventArgs e) { louceeng = 2; timera.Start(); if (n > louceeng) { a -= 20; label33.Location = new Point(510, 460 - a); if (n == louceeng) { timera.Stop(); } n--; } else if (n < louceeng) { label33.Location = new Point(510, 460 - a); a += 20; if (n == louceeng) { timera.Stop(); //timerkaimrn.Start(); } n++; } } private void label19_Click(object sender, EventArgs e) { } static int a = 0; static int n = 0; private void timera_Tick(object sender, EventArgs e) //电梯上下至乘客所在楼层 { if (n <= louceeng) //电梯上至乘客所在楼层 { label33.Location = new Point(510, 460 - a); a += 20; if (n == louceeng) { timera.Stop(); timerkaimrn.Start(); } label1.Text = Convert.ToString(n); //动态显示楼层数 n++; } else //电梯下至乘客所在楼层 { a -= 20; label33.Location = new Point(510, 460 - a); if (n == louceeng) { timera.Stop(); // timerkaimrn.Start(); } label1.Text = Convert.ToString(n-1); n--; } } static int louceeng = 0; private void comboBox2_TextChanged(object sender, EventArgs e) //当前楼层数 { louceeng = System.Int32.Parse(comboBox2.Text); timera.Start(); } int x = 0; private void timerkaimrn_Tick(object sender, EventArgs e) //电梯开 { x++; label34.Width = 54 - x; label35.Width = 54 - x; label35.Location = new Point(66+x, 14); if (x == 44) { timerkaimrn.Stop(); x = 0; } } private void timerguanmen_Tick(object sender, EventArgs e) //电梯关 { x++; label34.Width = 10 + x; label35.Width = 10 + x; label35.Location = new Point(110 - x, 14); if (x == 44) timerguanmen.Stop(); } private void button21_Click(object sender, EventArgs e) { louceeng = 0; timera.Start(); if (n > louceeng ) { a -= 20; label33.Location = new Point(510, 460 - a); if (n == louceeng ) { timera.Stop(); } n--; } else { ; } } private void button22_Click(object sender, EventArgs e)//内部开门按钮 { timerkaimrn.Start(); } private void label33_Click(object sender, EventArgs e) { } private void button23_Click(object sender, EventArgs e) //内部关门按钮 { timerguanmen.Start(); } private void label1_Click(object sender, EventArgs e) //动态显示楼层数 { } private void button8_Click(object sender, EventArgs e) { louceeng = 8; timera.Start(); if (n > louceeng) { a -= 20; label33.Location = new Point(510, 460 - a); if (n == louceeng) { timera.Stop(); } n--; } else if (n < louceeng) { label33.Location = new Point(510, 460 - a); a += 20; if (n == louceeng) { timera.Stop(); //timerkaimrn.Start(); } n++; } } private void button1_Click(object sender, EventArgs e) { louceeng = 1; timera.Start(); if (n > louceeng) { a -= 20; label33.Location = new Point(510, 460 - a); if (n == louceeng) { timera.Stop(); } n--; } else if (n < louceeng) { label33.Location = new Point(510, 460 - a); a += 20; if (n == louceeng) { timera.Stop(); //timerkaimrn.Start(); } n++; } } private void button3_Click(object sender, EventArgs e) { louceeng = 3; timera.Start(); if (n > louceeng) { a -= 20; label33.Location = new Point(510, 460 - a); if (n == louceeng) { timera.Stop(); } n--; } else if (n < louceeng) { label33.Location = new Point(510, 460 - a); a += 20; if (n == louceeng) { timera.Stop(); //timerkaimrn.Start(); } n++; } } private void button4_Click(object sender, EventArgs e) { louceeng = 4; timera.Start(); if (n > louceeng) { a -= 20; label33.Location = new Point(510, 460 - a); if (n == louceeng) { timera.Stop(); } n--; } else if (n < louceeng) { label33.Location = new Point(510, 460 - a); a += 20; if (n == louceeng) { timera.Stop(); //timerkaimrn.Start(); } n++; } } private void button5_Click(object sender, EventArgs e) { louceeng = 5; timera.Start(); if (n > louceeng) { a -= 20; label33.Location = new Point(510, 460 - a); if (n == louceeng) { timera.Stop(); } n--; } else if (n < louceeng) { label33.Location = new Point(510, 460 - a); a += 20; if (n == louceeng) { timera.Stop(); //timerkaimrn.Start(); } n++; } } private void button6_Click(object sender, EventArgs e) { louceeng = 6; timera.Start(); if (n > louceeng) { a -= 20; label33.Location = new Point(510, 460 - a); if (n == louceeng) { timera.Stop(); } n--; } else if (n < louceeng) { label33.Location = new Point(510, 460 - a); a += 20; if (n == louceeng) { timera.Stop(); //timerkaimrn.Start(); } n++; } } private void button7_Click(object sender, EventArgs e) { louceeng = 7; timera.Start(); if (n > louceeng) { a -= 20; label33.Location = new Point(510, 460 - a); if (n == louceeng) { timera.Stop(); } n--; } else if (n < louceeng) { label33.Location = new Point(510, 460 - a); a += 20; if (n == louceeng) { timera.Stop(); //timerkaimrn.Start(); } n++; } } private void button9_Click(object sender, EventArgs e) { louceeng = 9; timera.Start(); if (n > louceeng) { a -= 20; label33.Location = new Point(510, 460 - a); if (n == louceeng) { timera.Stop(); } n--; } else if (n < louceeng) { label33.Location = new Point(510, 460 - a); a += 20; if (n == louceeng) { timera.Stop(); //timerkaimrn.Start(); } n++; } } private void button10_Click(object sender, EventArgs e) { louceeng = 10; timera.Start(); if (n > louceeng) { a -= 20; label33.Location = new Point(510, 460 - a); if (n == louceeng) { timera.Stop(); } n--; } else if (n < louceeng) { label33.Location = new Point(510, 460 - a); a += 20; if (n == louceeng) { timera.Stop(); //timerkaimrn.Start(); } n++; } } private void button11_Click(object sender, EventArgs e) { louceeng = 11; timera.Start(); if (n > louceeng) { a -= 20; label33.Location = new Point(510, 460 - a); if (n == louceeng) { timera.Stop(); } n--; } else if (n < louceeng) { label33.Location = new Point(510, 460 - a); a += 20; if (n == louceeng) { timera.Stop(); //timerkaimrn.Start(); } n++; } } private void button12_Click(object sender, EventArgs e) { louceeng = 12; timera.Start(); if (n > louceeng) { a -= 20; label33.Location = new Point(510, 460 - a); if (n == louceeng) { timera.Stop(); } n--; } else if (n < louceeng) { label33.Location = new Point(510, 460 - a); a += 20; if (n == louceeng) { timera.Stop(); //timerkaimrn.Start(); } n++; } } private void button13_Click(object sender, EventArgs e) { louceeng = 13; timera.Start(); if (n > louceeng) { a -= 20; label33.Location = new Point(510, 460 - a); if (n == louceeng) { timera.Stop(); } n--; } else if (n < louceeng) { label33.Location = new Point(510, 460 - a); a += 20; if (n == louceeng) { timera.Stop(); //timerkaimrn.Start(); } n++; } } private void button14_Click(object sender, EventArgs e) { louceeng = 14; timera.Start(); if (n > louceeng) { a -= 20; label33.Location = new Point(510, 460 - a); if (n == louceeng) { timera.Stop(); } n--; } else if (n < louceeng) { label33.Location = new Point(510, 460 - a); a += 20; if (n == louceeng) { timera.Stop(); //timerkaimrn.Start(); } n++; } } private void button15_Click(object sender, EventArgs e) { louceeng = 15; timera.Start(); if (n > louceeng) { a -= 20; label33.Location = new Point(510, 460 - a); if (n == louceeng) { timera.Stop(); } n--; } else if (n < louceeng) { label33.Location = new Point(510, 460 - a); a += 20; if (n == louceeng) { timera.Stop(); //timerkaimrn.Start(); } n++; } } private void button16_Click(object sender, EventArgs e) { louceeng = 16; timera.Start(); if (n > louceeng) { a -= 20; label33.Location = new Point(510, 460 - a); if (n == louceeng) { timera.Stop(); } n--; } else if (n < louceeng) { label33.Location = new Point(510, 460 - a); a += 20; if (n == louceeng) { timera.Stop(); //timerkaimrn.Start(); } n++; } } private void button17_Click(object sender, EventArgs e) { louceeng = 17; timera.Start(); if (n > louceeng) { a -= 20; label33.Location = new Point(510, 460 - a); if (n == louceeng) { timera.Stop(); } n--; } else if (n < louceeng) { label33.Location = new Point(510, 460 - a); a += 20; if (n == louceeng) { timera.Stop(); //timerkaimrn.Start(); } n++; } } private void button18_Click(object sender, EventArgs e) { louceeng = 18; timera.Start(); if (n > louceeng) { a -= 20; label33.Location = new Point(510, 460 - a); if (n == louceeng) { timera.Stop(); } n--; } else if (n < louceeng) { label33.Location = new Point(510, 460 - a); a += 20; if (n == louceeng) { timera.Stop(); //timerkaimrn.Start(); } n++; } } private void button19_Click(object sender, EventArgs e) { louceeng = 19; timera.Start(); if (n > louceeng) { a -= 20; label33.Location = new Point(510, 460 - a); if (n == louceeng) { timera.Stop(); } n--; } else if (n < louceeng) { label33.Location = new Point(510, 460 - a); a += 20; if (n == louceeng) { timera.Stop(); //timerkaimrn.Start(); } n++; } } private void button20_Click(object sender, EventArgs e) { louceeng = 20; timera.Start(); if (n > louceeng) { a -= 20; label33.Location = new Point(510, 460 - a); if (n == louceeng) { timera.Stop(); } n--; } else if (n < louceeng) { label33.Location = new Point(510, 460 - a); a += 20; if (n == louceeng) { timera.Stop(); //timerkaimrn.Start(); } n++; } } } }
Form1.Designer.cs
namespace WindowsFormsApplication1 { 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.components = new System.ComponentModel.Container(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1)); this.button1 = new System.Windows.Forms.Button(); this.button2 = new System.Windows.Forms.Button(); this.button3 = new System.Windows.Forms.Button(); this.button4 = new System.Windows.Forms.Button(); this.button5 = new System.Windows.Forms.Button(); this.button6 = new System.Windows.Forms.Button(); this.button7 = new System.Windows.Forms.Button(); this.button8 = new System.Windows.Forms.Button(); this.button9 = new System.Windows.Forms.Button(); this.button10 = new System.Windows.Forms.Button(); this.button11 = new System.Windows.Forms.Button(); this.button12 = new System.Windows.Forms.Button(); this.button13 = new System.Windows.Forms.Button(); this.button14 = new System.Windows.Forms.Button(); this.button15 = new System.Windows.Forms.Button(); this.button16 = new System.Windows.Forms.Button(); this.button17 = new System.Windows.Forms.Button(); this.button18 = new System.Windows.Forms.Button(); this.button19 = new System.Windows.Forms.Button(); this.button20 = new System.Windows.Forms.Button(); this.button21 = new System.Windows.Forms.Button(); this.label1 = new System.Windows.Forms.Label(); this.button22 = new System.Windows.Forms.Button(); this.button23 = new System.Windows.Forms.Button(); this.label2 = new System.Windows.Forms.Label(); this.comboBox1 = new System.Windows.Forms.ComboBox(); this.comboBox2 = new System.Windows.Forms.ComboBox(); this.label3 = 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.label10 = new System.Windows.Forms.Label(); this.label11 = new System.Windows.Forms.Label(); this.label12 = new System.Windows.Forms.Label(); this.label13 = new System.Windows.Forms.Label(); this.label14 = new System.Windows.Forms.Label(); this.label15 = new System.Windows.Forms.Label(); this.label16 = new System.Windows.Forms.Label(); this.label17 = new System.Windows.Forms.Label(); this.label18 = new System.Windows.Forms.Label(); this.label19 = new System.Windows.Forms.Label(); this.label20 = new System.Windows.Forms.Label(); this.label21 = new System.Windows.Forms.Label(); this.label22 = new System.Windows.Forms.Label(); this.label23 = new System.Windows.Forms.Label(); this.label24 = new System.Windows.Forms.Label(); this.label25 = new System.Windows.Forms.Label(); this.label26 = new System.Windows.Forms.Label(); this.label27 = new System.Windows.Forms.Label(); this.label28 = new System.Windows.Forms.Label(); this.label29 = new System.Windows.Forms.Label(); this.label30 = new System.Windows.Forms.Label(); this.label31 = new System.Windows.Forms.Label(); this.label32 = new System.Windows.Forms.Label(); this.timera = new System.Windows.Forms.Timer(this.components); this.label33 = new System.Windows.Forms.Label(); this.label34 = new System.Windows.Forms.Label(); this.label35 = new System.Windows.Forms.Label(); this.timerkaimrn = new System.Windows.Forms.Timer(this.components); this.groupBox1 = new System.Windows.Forms.GroupBox(); this.timerguanmen = new System.Windows.Forms.Timer(this.components); this.radioButton1 = new System.Windows.Forms.RadioButton(); this.groupBox1.SuspendLayout(); this.SuspendLayout(); // // button1 // this.button1.Location = new System.Drawing.Point(30, 380); this.button1.Name = "button1"; this.button1.Size = new System.Drawing.Size(62, 23); this.button1.TabIndex = 0; this.button1.Text = "1"; this.button1.UseVisualStyleBackColor = true; this.button1.Click += new System.EventHandler(this.button1_Click); // // button2 // this.button2.Location = new System.Drawing.Point(98, 380); this.button2.Name = "button2"; this.button2.Size = new System.Drawing.Size(62, 23); this.button2.TabIndex = 1; this.button2.Text = "2"; this.button2.UseVisualStyleBackColor = true; this.button2.Click += new System.EventHandler(this.button2_Click); // // button3 // this.button3.Location = new System.Drawing.Point(30, 351); this.button3.Name = "button3"; this.button3.Size = new System.Drawing.Size(62, 23); this.button3.TabIndex = 2; this.button3.Text = "3"; this.button3.UseVisualStyleBackColor = true; this.button3.Click += new System.EventHandler(this.button3_Click); // // button4 // this.button4.Location = new System.Drawing.Point(98, 351); this.button4.Name = "button4"; this.button4.Size = new System.Drawing.Size(62, 23); this.button4.TabIndex = 3; this.button4.Text = "4"; this.button4.UseVisualStyleBackColor = true; this.button4.Click += new System.EventHandler(this.button4_Click); // // button5 // this.button5.Location = new System.Drawing.Point(30, 322); this.button5.Name = "button5"; this.button5.Size = new System.Drawing.Size(62, 23); this.button5.TabIndex = 4; this.button5.Text = "5"; this.button5.UseVisualStyleBackColor = true; this.button5.Click += new System.EventHandler(this.button5_Click); // // button6 // this.button6.Location = new System.Drawing.Point(98, 322); this.button6.Name = "button6"; this.button6.Size = new System.Drawing.Size(62, 23); this.button6.TabIndex = 5; this.button6.Text = "6"; this.button6.UseVisualStyleBackColor = true; this.button6.Click += new System.EventHandler(this.button6_Click); // // button7 // this.button7.Location = new System.Drawing.Point(30, 293); this.button7.Name = "button7"; this.button7.Size = new System.Drawing.Size(62, 23); this.button7.TabIndex = 6; this.button7.Text = "7"; this.button7.UseVisualStyleBackColor = true; this.button7.Click += new System.EventHandler(this.button7_Click); // // button8 // this.button8.Location = new System.Drawing.Point(98, 293); this.button8.Name = "button8"; this.button8.Size = new System.Drawing.Size(62, 23); this.button8.TabIndex = 7; this.button8.Text = "8"; this.button8.UseVisualStyleBackColor = true; this.button8.Click += new System.EventHandler(this.button8_Click); // // button9 // this.button9.Location = new System.Drawing.Point(30, 264); this.button9.Name = "button9"; this.button9.Size = new System.Drawing.Size(62, 23); this.button9.TabIndex = 8; this.button9.Text = "9"; this.button9.UseVisualStyleBackColor = true; this.button9.Click += new System.EventHandler(this.button9_Click); // // button10 // this.button10.Location = new System.Drawing.Point(98, 264); this.button10.Name = "button10"; this.button10.Size = new System.Drawing.Size(62, 23); this.button10.TabIndex = 9; this.button10.Text = "10"; this.button10.UseVisualStyleBackColor = true; this.button10.Click += new System.EventHandler(this.button10_Click); // // button11 // this.button11.Location = new System.Drawing.Point(30, 235); this.button11.Name = "button11"; this.button11.Size = new System.Drawing.Size(62, 23); this.button11.TabIndex = 10; this.button11.Text = "11"; this.button11.UseVisualStyleBackColor = true; this.button11.Click += new System.EventHandler(this.button11_Click); // // button12 // this.button12.Location = new System.Drawing.Point(98, 235); this.button12.Name = "button12"; this.button12.Size = new System.Drawing.Size(62, 23); this.button12.TabIndex = 11; this.button12.Text = "12"; this.button12.UseVisualStyleBackColor = true; this.button12.Click += new System.EventHandler(this.button12_Click); // // button13 // this.button13.Location = new System.Drawing.Point(30, 206); this.button13.Name = "button13"; this.button13.Size = new System.Drawing.Size(62, 23); this.button13.TabIndex = 12; this.button13.Text = "13"; this.button13.UseVisualStyleBackColor = true; this.button13.Click += new System.EventHandler(this.button13_Click); // // button14 // this.button14.Location = new System.Drawing.Point(98, 206); this.button14.Name = "button14"; this.button14.Size = new System.Drawing.Size(62, 23); this.button14.TabIndex = 13; this.button14.Text = "14"; this.button14.UseVisualStyleBackColor = true; this.button14.Click += new System.EventHandler(this.button14_Click); // // button15 // this.button15.Location = new System.Drawing.Point(30, 175); this.button15.Name = "button15"; this.button15.Size = new System.Drawing.Size(62, 23); this.button15.TabIndex = 14; this.button15.Text = "15"; this.button15.UseVisualStyleBackColor = true; this.button15.Click += new System.EventHandler(this.button15_Click); // // button16 // this.button16.Location = new System.Drawing.Point(98, 175); this.button16.Name = "button16"; this.button16.Size = new System.Drawing.Size(62, 23); this.button16.TabIndex = 15; this.button16.Text = "16"; this.button16.UseVisualStyleBackColor = true; this.button16.Click += new System.EventHandler(this.button16_Click); // // button17 // this.button17.Location = new System.Drawing.Point(30, 146); this.button17.Name = "button17"; this.button17.Size = new System.Drawing.Size(62, 23); this.button17.TabIndex = 16; this.button17.Text = "17"; this.button17.UseVisualStyleBackColor = true; this.button17.Click += new System.EventHandler(this.button17_Click); // // button18 // this.button18.Location = new System.Drawing.Point(98, 146); this.button18.Name = "button18"; this.button18.Size = new System.Drawing.Size(62, 23); this.button18.TabIndex = 17; this.button18.Text = "18"; this.button18.UseVisualStyleBackColor = true; this.button18.Click += new System.EventHandler(this.button18_Click); // // button19 // this.button19.Location = new System.Drawing.Point(30, 115); this.button19.Name = "button19"; this.button19.Size = new System.Drawing.Size(62, 23); this.button19.TabIndex = 18; this.button19.Text = "19"; this.button19.UseVisualStyleBackColor = true; this.button19.Click += new System.EventHandler(this.button19_Click); // // button20 // this.button20.Location = new System.Drawing.Point(98, 115); this.button20.Name = "button20"; this.button20.Size = new System.Drawing.Size(62, 23); this.button20.TabIndex = 19; this.button20.Text = "20"; this.button20.UseVisualStyleBackColor = true; this.button20.Click += new System.EventHandler(this.button20_Click); // // button21 // this.button21.Location = new System.Drawing.Point(53, 409); this.button21.Name = "button21"; this.button21.Size = new System.Drawing.Size(75, 23); this.button21.TabIndex = 20; this.button21.Text = "0"; this.button21.UseVisualStyleBackColor = true; this.button21.Click += new System.EventHandler(this.button21_Click); // // label1 // this.label1.BackColor = System.Drawing.Color.DimGray; this.label1.Font = new System.Drawing.Font("微软雅黑", 15.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label1.ForeColor = System.Drawing.Color.Red; this.label1.Location = new System.Drawing.Point(28, 42); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(132, 50); this.label1.TabIndex = 22; this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; this.label1.Click += new System.EventHandler(this.label1_Click); // // button22 // this.button22.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("button22.BackgroundImage"))); this.button22.Location = new System.Drawing.Point(98, 439); this.button22.Name = "button22"; this.button22.Size = new System.Drawing.Size(38, 23); this.button22.TabIndex = 23; this.button22.UseVisualStyleBackColor = true; this.button22.Click += new System.EventHandler(this.button22_Click); // // button23 // this.button23.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("button23.BackgroundImage"))); this.button23.Location = new System.Drawing.Point(44, 440); this.button23.Name = "button23"; this.button23.Size = new System.Drawing.Size(39, 23); this.button23.TabIndex = 24; this.button23.UseVisualStyleBackColor = true; this.button23.Click += new System.EventHandler(this.button23_Click); // // label2 // this.label2.AutoSize = true; this.label2.Location = new System.Drawing.Point(571, 481); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(11, 12); this.label2.TabIndex = 49; this.label2.Text = "A"; // // comboBox1 // this.comboBox1.FormattingEnabled = true; this.comboBox1.Items.AddRange(new object[] { "A电梯", "B电梯", "C电梯", "D电梯"}); this.comboBox1.Location = new System.Drawing.Point(381, 370); this.comboBox1.Name = "comboBox1"; this.comboBox1.Size = new System.Drawing.Size(69, 20); this.comboBox1.TabIndex = 50; this.comboBox1.Text = "A电梯"; // // comboBox2 // this.comboBox2.AutoCompleteCustomSource.AddRange(new string[] { "0F", "1F", "2F", "3F", "4F", "5F", "6F", "7F", "8F", "9F", "10F", "11F", "12F", "13F", "14F", "15F", "16F", "17F", "18F", "19F ", "20F"}); this.comboBox2.FormattingEnabled = true; this.comboBox2.Items.AddRange(new object[] { "0 ", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20"}); this.comboBox2.Location = new System.Drawing.Point(381, 436); this.comboBox2.Name = "comboBox2"; this.comboBox2.Size = new System.Drawing.Size(69, 20); this.comboBox2.TabIndex = 51; this.comboBox2.TextChanged += new System.EventHandler(this.comboBox2_TextChanged); // // label3 // this.label3.AutoSize = true; this.label3.Location = new System.Drawing.Point(665, 481); this.label3.Name = "label3"; this.label3.Size = new System.Drawing.Size(11, 12); this.label3.TabIndex = 73; this.label3.Text = "B"; // // label7 // this.label7.AutoSize = true; this.label7.Location = new System.Drawing.Point(775, 481); this.label7.Name = "label7"; this.label7.Size = new System.Drawing.Size(11, 12); this.label7.TabIndex = 77; this.label7.Text = "C"; // // label8 // this.label8.AutoSize = true; this.label8.Location = new System.Drawing.Point(888, 481); this.label8.Name = "label8"; this.label8.Size = new System.Drawing.Size(11, 12); this.label8.TabIndex = 79; this.label8.Text = "D"; // // label9 // this.label9.AutoSize = true; this.label9.Location = new System.Drawing.Point(327, 439); this.label9.Name = "label9"; this.label9.Size = new System.Drawing.Size(53, 12); this.label9.TabIndex = 80; this.label9.Text = "当前楼层"; // // label10 // this.label10.AutoSize = true; this.label10.Location = new System.Drawing.Point(327, 373); this.label10.Name = "label10"; this.label10.Size = new System.Drawing.Size(53, 12); this.label10.TabIndex = 81; this.label10.Text = "选择电梯"; // // label11 // this.label11.BackColor = System.Drawing.Color.White; this.label11.Location = new System.Drawing.Point(550, 460); this.label11.Name = "label11"; this.label11.Size = new System.Drawing.Size(47, 10); this.label11.TabIndex = 82; this.label11.Text = " 0 F"; // // label12 // this.label12.AutoSize = true; this.label12.BackColor = System.Drawing.SystemColors.Control; this.label12.Location = new System.Drawing.Point(550, 440); this.label12.Name = "label12"; this.label12.Size = new System.Drawing.Size(35, 12); this.label12.TabIndex = 83; this.label12.Text = " 1 F"; // // label13 // this.label13.AutoSize = true; this.label13.Location = new System.Drawing.Point(550, 420); this.label13.Name = "label13"; this.label13.Size = new System.Drawing.Size(35, 12); this.label13.TabIndex = 84; this.label13.Text = " 2 F"; // // label14 // this.label14.AutoSize = true; this.label14.Location = new System.Drawing.Point(550, 400); this.label14.Name = "label14"; this.label14.Size = new System.Drawing.Size(35, 12); this.label14.TabIndex = 85; this.label14.Text = " 3 F"; // // label15 // this.label15.AutoSize = true; this.label15.Location = new System.Drawing.Point(550, 380); this.label15.Name = "label15"; this.label15.Size = new System.Drawing.Size(35, 12); this.label15.TabIndex = 86; this.label15.Text = " 4 F"; // // label16 // this.label16.AutoSize = true; this.label16.Location = new System.Drawing.Point(550, 360); this.label16.Name = "label16"; this.label16.Size = new System.Drawing.Size(35, 12); this.label16.TabIndex = 87; this.label16.Text = " 5 F"; // // label17 // this.label17.AutoSize = true; this.label17.Location = new System.Drawing.Point(550, 340); this.label17.Name = "label17"; this.label17.Size = new System.Drawing.Size(35, 12); this.label17.TabIndex = 88; this.label17.Text = " 6 F"; // // label18 // this.label18.AutoSize = true; this.label18.Location = new System.Drawing.Point(550, 320); this.label18.Name = "label18"; this.label18.Size = new System.Drawing.Size(35, 12); this.label18.TabIndex = 89; this.label18.Text = " 7 F"; // // label19 // this.label19.AutoSize = true; this.label19.Location = new System.Drawing.Point(550, 300); this.label19.Name = "label19"; this.label19.Size = new System.Drawing.Size(35, 12); this.label19.TabIndex = 90; this.label19.Text = " 8 F"; this.label19.Click += new System.EventHandler(this.label19_Click); // // label20 // this.label20.AutoSize = true; this.label20.Location = new System.Drawing.Point(550, 280); this.label20.Name = "label20"; this.label20.Size = new System.Drawing.Size(35, 12); this.label20.TabIndex = 91; this.label20.Text = " 9 F"; // // label21 // this.label21.AutoSize = true; this.label21.Location = new System.Drawing.Point(550, 260); this.label21.Name = "label21"; this.label21.Size = new System.Drawing.Size(41, 12); this.label21.TabIndex = 92; this.label21.Text = " 10 F"; // // label22 // this.label22.AutoSize = true; this.label22.Location = new System.Drawing.Point(550, 240); this.label22.Name = "label22"; this.label22.Size = new System.Drawing.Size(41, 12); this.label22.TabIndex = 93; this.label22.Text = " 11 F"; // // label23 // this.label23.AutoSize = true; this.label23.Location = new System.Drawing.Point(550, 220); this.label23.Name = "label23"; this.label23.Size = new System.Drawing.Size(41, 12); this.label23.TabIndex = 94; this.label23.Text = " 12 F"; // // label24 // this.label24.AutoSize = true; this.label24.Location = new System.Drawing.Point(550, 200); this.label24.Name = "label24"; this.label24.Size = new System.Drawing.Size(41, 12); this.label24.TabIndex = 95; this.label24.Text = " 13 F"; // // label25 // this.label25.AutoSize = true; this.label25.Location = new System.Drawing.Point(550, 180); this.label25.Name = "label25"; this.label25.Size = new System.Drawing.Size(41, 12); this.label25.TabIndex = 96; this.label25.Text = " 14 F"; // // label26 // this.label26.AutoSize = true; this.label26.Location = new System.Drawing.Point(550, 160); this.label26.Name = "label26"; this.label26.Size = new System.Drawing.Size(41, 12); this.label26.TabIndex = 97; this.label26.Text = " 15 F"; // // label27 // this.label27.AutoSize = true; this.label27.Location = new System.Drawing.Point(550, 140); this.label27.Name = "label27"; this.label27.Size = new System.Drawing.Size(41, 12); this.label27.TabIndex = 98; this.label27.Text = " 16 F"; // // label28 // this.label28.AutoSize = true; this.label28.Location = new System.Drawing.Point(550, 120); this.label28.Name = "label28"; this.label28.Size = new System.Drawing.Size(41, 12); this.label28.TabIndex = 99; this.label28.Text = " 17 F"; // // label29 // this.label29.AutoSize = true; this.label29.Location = new System.Drawing.Point(550, 100); this.label29.Name = "label29"; this.label29.Size = new System.Drawing.Size(41, 12); this.label29.TabIndex = 100; this.label29.Text = " 18 F"; // // label30 // this.label30.AutoSize = true; this.label30.Location = new System.Drawing.Point(550, 80); this.label30.Name = "label30"; this.label30.Size = new System.Drawing.Size(41, 12); this.label30.TabIndex = 101; this.label30.Text = " 19 F"; // // label31 // this.label31.AutoSize = true; this.label31.Location = new System.Drawing.Point(550, 60); this.label31.Name = "label31"; this.label31.Size = new System.Drawing.Size(41, 12); this.label31.TabIndex = 102; this.label31.Text = " 20 F"; // // label32 // this.label32.AutoSize = true; this.label32.Location = new System.Drawing.Point(649, 460); this.label32.Name = "label32"; this.label32.Size = new System.Drawing.Size(47, 12); this.label32.TabIndex = 103; this.label32.Text = "label32"; // // timera // this.timera.Enabled = true; this.timera.Interval = 1000; this.timera.Tick += new System.EventHandler(this.timera_Tick); // // label33 // this.label33.AutoSize = true; this.label33.BackColor = System.Drawing.Color.Lime; this.label33.Location = new System.Drawing.Point(510, 460); this.label33.Name = "label33"; this.label33.Size = new System.Drawing.Size(47, 12); this.label33.TabIndex = 105; this.label33.Text = "label33"; this.label33.Click += new System.EventHandler(this.label33_Click); // // label34 // this.label34.BackColor = System.Drawing.SystemColors.AppWorkspace; this.label34.Location = new System.Drawing.Point(6, 14); this.label34.Name = "label34"; this.label34.Size = new System.Drawing.Size(54, 100); this.label34.TabIndex = 106; this.label34.Text = "label34"; // // label35 // this.label35.BackColor = System.Drawing.SystemColors.ActiveBorder; this.label35.Location = new System.Drawing.Point(66, 14); this.label35.Name = "label35"; this.label35.Size = new System.Drawing.Size(54, 100); this.label35.TabIndex = 107; this.label35.Text = "label35"; // // timerkaimrn // this.timerkaimrn.Tick += new System.EventHandler(this.timerkaimrn_Tick); // // groupBox1 // this.groupBox1.BackColor = System.Drawing.SystemColors.ActiveCaptionText; this.groupBox1.Controls.Add(this.label34); this.groupBox1.Controls.Add(this.label35); this.groupBox1.Location = new System.Drawing.Point(747, 87); this.groupBox1.Name = "groupBox1"; this.groupBox1.Size = new System.Drawing.Size(127, 120); this.groupBox1.TabIndex = 108; this.groupBox1.TabStop = false; // // timerguanmen // this.timerguanmen.Tick += new System.EventHandler(this.timerguanmen_Tick); // // radioButton1 // this.radioButton1.AutoSize = true; this.radioButton1.Location = new System.Drawing.Point(154, 442); this.radioButton1.Name = "radioButton1"; this.radioButton1.Size = new System.Drawing.Size(95, 16); this.radioButton1.TabIndex = 109; this.radioButton1.TabStop = true; this.radioButton1.Text = "radioButton1"; this.radioButton1.UseVisualStyleBackColor = true; // // Form1 // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(1016, 515); this.Controls.Add(this.radioButton1); this.Controls.Add(this.groupBox1); this.Controls.Add(this.label33); this.Controls.Add(this.label32); this.Controls.Add(this.label31); this.Controls.Add(this.label30); this.Controls.Add(this.label29); this.Controls.Add(this.label28); this.Controls.Add(this.label27); this.Controls.Add(this.label26); this.Controls.Add(this.label25); this.Controls.Add(this.label24); this.Controls.Add(this.label23); this.Controls.Add(this.label22); this.Controls.Add(this.label21); this.Controls.Add(this.label20); this.Controls.Add(this.label19); this.Controls.Add(this.label18); this.Controls.Add(this.label17); this.Controls.Add(this.label16); this.Controls.Add(this.label15); this.Controls.Add(this.label14); this.Controls.Add(this.label13); this.Controls.Add(this.label12); this.Controls.Add(this.label11); this.Controls.Add(this.label10); this.Controls.Add(this.label9); this.Controls.Add(this.label8); this.Controls.Add(this.label7); this.Controls.Add(this.label3); this.Controls.Add(this.comboBox2); this.Controls.Add(this.comboBox1); this.Controls.Add(this.label2); this.Controls.Add(this.button23); this.Controls.Add(this.button22); this.Controls.Add(this.label1); this.Controls.Add(this.button21); this.Controls.Add(this.button20); this.Controls.Add(this.button19); this.Controls.Add(this.button18); this.Controls.Add(this.button17); this.Controls.Add(this.button16); this.Controls.Add(this.button15); this.Controls.Add(this.button14); this.Controls.Add(this.button13); this.Controls.Add(this.button12); this.Controls.Add(this.button11); this.Controls.Add(this.button10); this.Controls.Add(this.button9); this.Controls.Add(this.button8); this.Controls.Add(this.button7); this.Controls.Add(this.button6); this.Controls.Add(this.button5); this.Controls.Add(this.button4); this.Controls.Add(this.button3); this.Controls.Add(this.button2); this.Controls.Add(this.button1); this.ForeColor = System.Drawing.SystemColors.ActiveCaptionText; this.Name = "Form1"; this.groupBox1.ResumeLayout(false); this.ResumeLayout(false); this.PerformLayout(); } #endregion private System.Windows.Forms.Button button1; private System.Windows.Forms.Button button2; private System.Windows.Forms.Button button3; private System.Windows.Forms.Button button4; private System.Windows.Forms.Button button5; private System.Windows.Forms.Button button6; private System.Windows.Forms.Button button7; private System.Windows.Forms.Button button8; private System.Windows.Forms.Button button9; private System.Windows.Forms.Button button10; private System.Windows.Forms.Button button11; private System.Windows.Forms.Button button12; private System.Windows.Forms.Button button13; private System.Windows.Forms.Button button14; private System.Windows.Forms.Button button15; private System.Windows.Forms.Button button16; private System.Windows.Forms.Button button17; private System.Windows.Forms.Button button18; private System.Windows.Forms.Button button19; private System.Windows.Forms.Button button20; private System.Windows.Forms.Button button21; private System.Windows.Forms.Label label1; private System.Windows.Forms.Button button22; private System.Windows.Forms.Button button23; private System.Windows.Forms.Label label2; private System.Windows.Forms.ComboBox comboBox1; private System.Windows.Forms.ComboBox comboBox2; private System.Windows.Forms.Label label3; private System.Windows.Forms.Label label7; private System.Windows.Forms.Label label8; private System.Windows.Forms.Label label9; private System.Windows.Forms.Label label10; private System.Windows.Forms.Label label11; private System.Windows.Forms.Label label12; private System.Windows.Forms.Label label13; private System.Windows.Forms.Label label14; private System.Windows.Forms.Label label15; private System.Windows.Forms.Label label16; private System.Windows.Forms.Label label17; private System.Windows.Forms.Label label18; private System.Windows.Forms.Label label19; private System.Windows.Forms.Label label20; private System.Windows.Forms.Label label21; private System.Windows.Forms.Label label22; private System.Windows.Forms.Label label23; private System.Windows.Forms.Label label24; private System.Windows.Forms.Label label25; private System.Windows.Forms.Label label26; private System.Windows.Forms.Label label27; private System.Windows.Forms.Label label28; private System.Windows.Forms.Label label29; private System.Windows.Forms.Label label30; private System.Windows.Forms.Label label31; private System.Windows.Forms.Label label32; private System.Windows.Forms.Timer timera; private System.Windows.Forms.Label label33; private System.Windows.Forms.Label label34; private System.Windows.Forms.Label label35; private System.Windows.Forms.Timer timerkaimrn; private System.Windows.Forms.GroupBox groupBox1; private System.Windows.Forms.Timer timerguanmen; private System.Windows.Forms.RadioButton radioButton1; } }
Program.cs
using System; using System.Collections.Generic; using System.Linq; using System.Windows.Forms; namespace WindowsFormsApplication1 { static class Program { /// <summary> /// 应用程序的主入口点。 /// </summary> [STAThread] static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new Form1()); } } }
好多功能还没有完善,希望大家多指点指点~