📄 formaddress.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 FormAddress.
/// </summary>
public class FormAddress : System.Windows.Forms.Form, IDisposable
{
private TextBox txtAddress;
private Label lblInstructions;
private Label lblInstructions2;
private MenuItem menuDone;
private MenuItem menuCancel;
/// <summary>
/// Main menu for the form.
/// </summary>
private System.Windows.Forms.MainMenu mainMenu1;
public FormAddress()
{
InitializeComponent();
DpiHelper.AdjustAllControls(this);
}
/// <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.menuCancel = new System.Windows.Forms.MenuItem();
this.txtAddress = new System.Windows.Forms.TextBox();
this.lblInstructions = new System.Windows.Forms.Label();
this.lblInstructions2 = new System.Windows.Forms.Label();
//
// 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);
//
// menuCancel
//
this.menuCancel.Text = "Cancel";
this.menuCancel.Click += new System.EventHandler(this.menuCancel_Click);
//
// txtAddress
//
this.txtAddress.Location = new System.Drawing.Point(4, 56);
this.txtAddress.Size = new System.Drawing.Size(169, 24);
//
// lblInstructions
//
this.lblInstructions.Location = new System.Drawing.Point(4, 9);
this.lblInstructions.Size = new System.Drawing.Size(152, 22);
this.lblInstructions.Text = "Enter an address, or";
//
// lblInstructions2
//
this.lblInstructions2.Location = new System.Drawing.Point(4, 31);
this.lblInstructions2.Size = new System.Drawing.Size(152, 22);
this.lblInstructions2.Text = "the name of a place:";
//
// FormAddress
//
this.ClientSize = new System.Drawing.Size(176, 180);
this.Controls.Add(this.lblInstructions);
this.Controls.Add(this.txtAddress);
this.Controls.Add(this.lblInstructions2);
this.Menu = this.mainMenu1;
this.Text = "Find an Address or Place";
}
#endregion
public string Address
{
get { return txtAddress.Text; }
}
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 + -