📄 formlatlong.cs
字号:
// Copyright (c) Jason Fuller.
//
// Use of this source code is subject to the terms of the license found in the
// file License.txt. If you did not accept the terms of that license, you are
// not authorized to use this source code.
#region Using directives
using System;
using System.Drawing;
using System.Collections;
using System.Windows.Forms;
using System.Data;
#endregion
namespace PocketEarth
{
/// <summary>
/// Summary description for FormLatLong.
/// </summary>
public class FormLatLong : System.Windows.Forms.Form
{
private Label labelLatitude;
private TextBox txtLatitude;
private MenuItem menuDone;
private TextBox txtLongitude;
private Label labelLongitude;
private MenuItem menuCancel;
/// <summary>
/// Main menu for the form.
/// </summary>
private System.Windows.Forms.MainMenu mainMenu1;
public FormLatLong()
{
InitializeComponent();
DpiHelper.AdjustAllControls(this);
}
public double Latitude
{
get { return Convert.ToDouble(txtLatitude.Text); }
set { txtLatitude.Text = value.ToString(); }
}
public double Longitude
{
get { return Convert.ToDouble(txtLongitude.Text); }
set { txtLongitude.Text = value.ToString(); }
}
/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose(bool disposing)
{
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.mainMenu1 = new System.Windows.Forms.MainMenu();
this.menuDone = new System.Windows.Forms.MenuItem();
this.labelLatitude = new System.Windows.Forms.Label();
this.txtLatitude = new System.Windows.Forms.TextBox();
this.txtLongitude = new System.Windows.Forms.TextBox();
this.labelLongitude = new System.Windows.Forms.Label();
this.menuCancel = new System.Windows.Forms.MenuItem();
//
// mainMenu1
//
this.mainMenu1.MenuItems.Add(this.menuDone);
this.mainMenu1.MenuItems.Add(this.menuCancel);
//
// menuDone
//
this.menuDone.Text = "Done";
this.menuDone.Click += new System.EventHandler(this.menuDone_Click);
//
// labelLatitude
//
this.labelLatitude.Location = new System.Drawing.Point(3, 9);
this.labelLatitude.Size = new System.Drawing.Size(152, 22);
this.labelLatitude.Text = "Latitude";
//
// txtLatitude
//
this.txtLatitude.Location = new System.Drawing.Point(3, 34);
this.txtLatitude.Size = new System.Drawing.Size(152, 24);
//
// txtLongitude
//
this.txtLongitude.Location = new System.Drawing.Point(3, 89);
this.txtLongitude.Size = new System.Drawing.Size(152, 24);
//
// labelLongitude
//
this.labelLongitude.Location = new System.Drawing.Point(3, 61);
this.labelLongitude.Size = new System.Drawing.Size(152, 25);
this.labelLongitude.Text = "Longitude ";
//
// menuCancel
//
this.menuCancel.Text = "Cancel";
this.menuCancel.Click += new System.EventHandler(this.menuCancel_Click);
//
// FormLatLong
//
this.ClientSize = new System.Drawing.Size(176, 180);
this.Controls.Add(this.txtLongitude);
this.Controls.Add(this.labelLongitude);
this.Controls.Add(this.txtLatitude);
this.Controls.Add(this.labelLatitude);
this.Menu = this.mainMenu1;
this.Text = "Go to Lat /Long";
}
#endregion
private void menuDone_Click(object sender, EventArgs e)
{
Close();
}
private void menuCancel_Click(object sender, EventArgs e)
{
this.DialogResult = DialogResult.Cancel;
Close();
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -