📄 mapselect.cs
字号:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using mapinfo;
using System.Text;
using System.IO;
namespace mapinfo
{
/// <summary>
/// Form2 的摘要说明。
/// </summary>
public class Form2 : System.Windows.Forms.Form
{
public System.Windows.Forms.ComboBox comboBox1;
//public Form2 form2 = new Form2();
public Form2()
{
//
// Windows 窗体设计器支持所必需的
//
InitializeComponent();
//
// TODO: 在 InitializeComponent 调用后添加任何构造函数代码
//
}
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
protected override void Dispose( bool disposing )
{
base.Dispose( disposing );
}
#region Windows 窗体设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
/// 此方法的内容。
/// </summary>
public void InitializeComponent()
{
this.comboBox1 = new System.Windows.Forms.ComboBox();
this.label1 = new System.Windows.Forms.Label();
//
// comboBox1
//
this.comboBox1.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular);
this.comboBox1.Location = new System.Drawing.Point(56, 72);
this.comboBox1.Size = new System.Drawing.Size(136, 22);
//
// label1
//
this.label1.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular);
this.label1.Location = new System.Drawing.Point(88, 40);
this.label1.Size = new System.Drawing.Size(64, 16);
this.label1.Text = "地图列表";
//
// Form2
//
this.ClientSize = new System.Drawing.Size(234, 271);
this.Controls.Add(this.label1);
this.Controls.Add(this.comboBox1);
this.MinimizeBox = false;
this.Text = "选择地图";
this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
this.Load += new System.EventHandler(this.Form2_Load);
this.Closed += new System.EventHandler(this.Form2_Closed);
}
#endregion
public void Form2_Load(object sender, System.EventArgs e)
{
int i;
for(i = 0; i < 10; i++)
{
if(mapinfo.Form1.maplist[i].title.Length == 0)
{
break;
}
comboBox1.Items.Add(mapinfo.Form1.maplist[i].title);
}
}
private System.Windows.Forms.Label label1;
public static int g_mapselect = 0xFF;
public void Form2_Closed(object sender, System.EventArgs e)
{
if((g_mapselect == comboBox1.SelectedIndex) || (comboBox1.SelectedIndex == -1))
{
return;
}
g_mapselect = comboBox1.SelectedIndex;
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -