📄 insertsqlname.cs
字号:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
namespace 学生信息管理
{
/// <summary>
/// InsertSQLName 的摘要说明。
/// </summary>
public class InsertSQLName : System.Windows.Forms.Form
{
private System.Windows.Forms.TextBox txtSqlName;
private System.Windows.Forms.Button btnOk;
private System.Windows.Forms.Button btnNo;
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.Container components = null;
public InsertSQLName()
{
//
// Windows 窗体设计器支持所必需的
//
InitializeComponent();
//
// TODO: 在 InitializeComponent 调用后添加任何构造函数代码
//
}
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if(components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Windows 窗体设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
/// 此方法的内容。
/// </summary>
private void InitializeComponent()
{
System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(InsertSQLName));
this.txtSqlName = new System.Windows.Forms.TextBox();
this.btnOk = new System.Windows.Forms.Button();
this.btnNo = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// txtSqlName
//
this.txtSqlName.Location = new System.Drawing.Point(8, 8);
this.txtSqlName.Name = "txtSqlName";
this.txtSqlName.Size = new System.Drawing.Size(352, 21);
this.txtSqlName.TabIndex = 0;
this.txtSqlName.Text = "";
//
// btnOk
//
this.btnOk.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
this.btnOk.Location = new System.Drawing.Point(85, 40);
this.btnOk.Name = "btnOk";
this.btnOk.Size = new System.Drawing.Size(80, 32);
this.btnOk.TabIndex = 1;
this.btnOk.Text = "保 存";
this.btnOk.Click += new System.EventHandler(this.btnOk_Click);
//
// btnNo
//
this.btnNo.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
this.btnNo.Location = new System.Drawing.Point(197, 40);
this.btnNo.Name = "btnNo";
this.btnNo.Size = new System.Drawing.Size(80, 32);
this.btnNo.TabIndex = 2;
this.btnNo.Text = "以后再说";
this.btnNo.Click += new System.EventHandler(this.btnNo_Click);
//
// InsertSQLName
//
this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
this.ClientSize = new System.Drawing.Size(370, 85);
this.Controls.Add(this.btnNo);
this.Controls.Add(this.btnOk);
this.Controls.Add(this.txtSqlName);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Name = "InsertSQLName";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "请输入本次查询的名称,以方便下次查询";
this.ResumeLayout(false);
}
#endregion
public TextBox SqlName
{
get{return this.txtSqlName;}
set{this.txtSqlName = value;}
}
//保存
private void btnOk_Click(object sender, System.EventArgs e)
{
if(this.txtSqlName.Text.Length == 0)
{
MessageBox.Show("请输入本次查询的名称!");
return;
}
if(this.txtSqlName.Text.IndexOf("'",0) != -1 || this.txtSqlName.Text.IndexOf("\"",0) != -1)
{
MessageBox.Show("请不要输入特殊字符!");
return;
}
this.DialogResult = DialogResult.OK;
}
private void btnNo_Click(object sender, System.EventArgs e)
{
this.DialogResult = DialogResult.Cancel;
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -