📄 inputform.cs
字号:
#region Using 指令
using System;
using System.Drawing;
using System.Collections;
using System.Windows.Forms;
using System.Data;
#endregion
namespace ffDialog
{
/// <summary>
/// InputForm 的摘要说明。
/// </summary>
class InputForm : System.Windows.Forms.Form
{
private Label InfoLabel;
private TextBox InputText;
private MenuItem OKMenu;
private MenuItem CancelMenu;
/// <summary>
/// 窗体的主菜单。
/// </summary>
private System.Windows.Forms.MainMenu mainMenu1;
public InputForm()
{
InitializeComponent();
}
//返回的文件名
public string FileName
{
get
{
return InputText.Text;
}
set
{
InputText.Text = value;
}
}
//设置提示信息
public string Info
{
set
{
InfoLabel.Text = value;
}
}
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
protected override void Dispose(bool disposing)
{
base.Dispose(disposing);
}
#region Windows 窗体设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要
/// 使用代码编辑器修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.mainMenu1 = new System.Windows.Forms.MainMenu();
this.OKMenu = new System.Windows.Forms.MenuItem();
this.CancelMenu = new System.Windows.Forms.MenuItem();
this.InfoLabel = new System.Windows.Forms.Label();
this.InputText = new System.Windows.Forms.TextBox();
//
// mainMenu1
//
this.mainMenu1.MenuItems.Add(this.OKMenu);
this.mainMenu1.MenuItems.Add(this.CancelMenu);
//
// OKMenu
//
this.OKMenu.Text = "确定";
this.OKMenu.Click += new System.EventHandler(this.OKMenu_Click);
//
// CancelMenu
//
this.CancelMenu.Text = "取消";
this.CancelMenu.Click += new System.EventHandler(this.CancelMenu_Click);
//
// InfoLabel
//
this.InfoLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular);
this.InfoLabel.ForeColor = System.Drawing.Color.Black;
this.InfoLabel.Location = new System.Drawing.Point(3, 9);
this.InfoLabel.Size = new System.Drawing.Size(170, 22);
this.InfoLabel.Text = "InfoLabel";
//
// InputText
//
this.InputText.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular);
this.InputText.ForeColor = System.Drawing.Color.Black;
this.InputText.Location = new System.Drawing.Point(3, 34);
this.InputText.Size = new System.Drawing.Size(170, 20);
//
// InputForm
//
this.ClientSize = new System.Drawing.Size(240, 268);
this.Controls.Add(this.InfoLabel);
this.Controls.Add(this.InputText);
this.ForeColor = System.Drawing.Color.Black;
this.Menu = this.mainMenu1;
this.Load += new System.EventHandler(this.InputForm_Load);
}
#endregion
//确定
private void OKMenu_Click(object sender, EventArgs e)
{
InputText.Text = InputText.Text + "";
this.DialogResult = DialogResult.Yes;
this.Close();
}
//取消
private void CancelMenu_Click(object sender, EventArgs e)
{
InputText.Text = InputText.Text + "";
this.DialogResult = DialogResult.Cancel;
this.Close();
}
private void InputForm_Load(object sender, EventArgs e)
{
InputText.SelectAll();
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -