📄 stud_info.cs
字号:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.Data.SqlClient;
namespace chaxun
{
/// <summary>
/// Stud_info 的摘要说明。
/// </summary>
public class Stud_info : System.Windows.Forms.Form
{
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.Label label7;
private System.Windows.Forms.Label label8;
private System.Windows.Forms.DataGrid dataGrid1;
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.TextBox txt_Xh;
private System.Windows.Forms.TextBox txt_Xm;
private System.Windows.Forms.TextBox txt_sex;
private System.Windows.Forms.TextBox txt_addr;
private System.Windows.Forms.TextBox txt_csrq;
private System.Windows.Forms.TextBox txt_tel;
private System.Windows.Forms.TextBox txt_count;
private System.Windows.Forms.GroupBox groupBox2;
private System.Windows.Forms.GroupBox groupBox3;
private System.Windows.Forms.Button btn_top;
private System.Windows.Forms.Button btn_syt;
private System.Windows.Forms.Button btn_xyt;
private System.Windows.Forms.Button btn_bottom;
private System.Windows.Forms.Button btn_add;
private System.Windows.Forms.Button btn_save;
private System.Windows.Forms.Button btn_change;
private System.Windows.Forms.Button btn_dele;
private Class1 link = new Class1 ();
private string sendSQL=" select xh as 学号,xm as 姓名,xb as 性别 ,csrq as 出生日期,txdz as 家庭地址,lxdf as 电话号码,QQhm as QQ号码 from student ";
private string sendtable="student";
private CurrencyManager cmAmend;
private DataTable myTable=new DataTable();
private DataSet ds=new DataSet();
private System.Windows.Forms.TextBox txt_qqhm;
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.Container components = null;
public Stud_info()
{
//
// Windows 窗体设计器支持所必需的
//
InitializeComponent();
this.ds=link.SelectDataBase(sendSQL,sendtable);
this.myTable=ds.Tables[0];
//
// 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()
{
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label();
this.label5 = new System.Windows.Forms.Label();
this.label6 = new System.Windows.Forms.Label();
this.label7 = new System.Windows.Forms.Label();
this.label8 = new System.Windows.Forms.Label();
this.dataGrid1 = new System.Windows.Forms.DataGrid();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.txt_count = new System.Windows.Forms.TextBox();
this.txt_tel = new System.Windows.Forms.TextBox();
this.txt_csrq = new System.Windows.Forms.TextBox();
this.txt_addr = new System.Windows.Forms.TextBox();
this.txt_sex = new System.Windows.Forms.TextBox();
this.txt_qqhm = new System.Windows.Forms.TextBox();
this.txt_Xm = new System.Windows.Forms.TextBox();
this.txt_Xh = new System.Windows.Forms.TextBox();
this.btn_top = new System.Windows.Forms.Button();
this.btn_syt = new System.Windows.Forms.Button();
this.btn_xyt = new System.Windows.Forms.Button();
this.btn_bottom = new System.Windows.Forms.Button();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.groupBox3 = new System.Windows.Forms.GroupBox();
this.btn_dele = new System.Windows.Forms.Button();
this.btn_change = new System.Windows.Forms.Button();
this.btn_save = new System.Windows.Forms.Button();
this.btn_add = new System.Windows.Forms.Button();
((System.ComponentModel.ISupportInitialize)(this.dataGrid1)).BeginInit();
this.groupBox1.SuspendLayout();
this.groupBox2.SuspendLayout();
this.groupBox3.SuspendLayout();
this.SuspendLayout();
//
// label1
//
this.label1.Location = new System.Drawing.Point(24, 25);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(60, 18);
this.label1.TabIndex = 0;
this.label1.Text = "学 号";
//
// label2
//
this.label2.Location = new System.Drawing.Point(24, 56);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(54, 18);
this.label2.TabIndex = 1;
this.label2.Text = "姓 名";
//
// label3
//
this.label3.Location = new System.Drawing.Point(24, 93);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(48, 18);
this.label3.TabIndex = 2;
this.label3.Text = "QQ号 码";
//
// label4
//
this.label4.Location = new System.Drawing.Point(24, 126);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(54, 18);
this.label4.TabIndex = 3;
this.label4.Text = "性 别";
//
// label5
//
this.label5.Location = new System.Drawing.Point(204, 25);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(54, 18);
this.label5.TabIndex = 4;
this.label5.Text = "地 址";
//
// label6
//
this.label6.Location = new System.Drawing.Point(204, 56);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(54, 18);
this.label6.TabIndex = 5;
this.label6.Text = "出生日期";
//
// label7
//
this.label7.Location = new System.Drawing.Point(204, 93);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(54, 18);
this.label7.TabIndex = 6;
this.label7.Text = "联系电话";
//
// label8
//
this.label8.Location = new System.Drawing.Point(204, 126);
this.label8.Name = "label8";
this.label8.Size = new System.Drawing.Size(54, 18);
this.label8.TabIndex = 7;
this.label8.Text = "记录条数";
//
// dataGrid1
//
this.dataGrid1.DataMember = "";
this.dataGrid1.HeaderForeColor = System.Drawing.SystemColors.ControlText;
this.dataGrid1.Location = new System.Drawing.Point(6, 0);
this.dataGrid1.Name = "dataGrid1";
this.dataGrid1.ReadOnly = true;
this.dataGrid1.Size = new System.Drawing.Size(426, 174);
this.dataGrid1.TabIndex = 8;
this.dataGrid1.CurrentCellChanged += new System.EventHandler(this.dataGrid1_CurrentCellChanged);
//
// groupBox1
//
this.groupBox1.Controls.Add(this.txt_count);
this.groupBox1.Controls.Add(this.txt_tel);
this.groupBox1.Controls.Add(this.txt_csrq);
this.groupBox1.Controls.Add(this.txt_addr);
this.groupBox1.Controls.Add(this.txt_sex);
this.groupBox1.Controls.Add(this.txt_qqhm);
this.groupBox1.Controls.Add(this.txt_Xm);
this.groupBox1.Controls.Add(this.txt_Xh);
this.groupBox1.Controls.Add(this.label6);
this.groupBox1.Controls.Add(this.label3);
this.groupBox1.Controls.Add(this.label5);
this.groupBox1.Controls.Add(this.label8);
this.groupBox1.Controls.Add(this.label2);
this.groupBox1.Controls.Add(this.label4);
this.groupBox1.Controls.Add(this.label7);
this.groupBox1.Controls.Add(this.label1);
this.groupBox1.Location = new System.Drawing.Point(0, 174);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(432, 156);
this.groupBox1.TabIndex = 9;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "信息";
//
// txt_count
//
this.txt_count.Location = new System.Drawing.Point(270, 124);
this.txt_count.Name = "txt_count";
this.txt_count.ReadOnly = true;
this.txt_count.Size = new System.Drawing.Size(138, 21);
this.txt_count.TabIndex = 15;
this.txt_count.Text = "";
this.txt_count.TextChanged += new System.EventHandler(this.textBox8_TextChanged);
//
// txt_tel
//
this.txt_tel.Location = new System.Drawing.Point(270, 92);
this.txt_tel.Name = "txt_tel";
this.txt_tel.ReadOnly = true;
this.txt_tel.Size = new System.Drawing.Size(138, 21);
this.txt_tel.TabIndex = 14;
this.txt_tel.Text = "";
this.txt_tel.TextChanged += new System.EventHandler(this.textBox7_TextChanged);
//
// txt_csrq
//
this.txt_csrq.Location = new System.Drawing.Point(270, 54);
this.txt_csrq.Name = "txt_csrq";
this.txt_csrq.ReadOnly = true;
this.txt_csrq.Size = new System.Drawing.Size(138, 21);
this.txt_csrq.TabIndex = 13;
this.txt_csrq.Text = "";
this.txt_csrq.TextChanged += new System.EventHandler(this.textBox6_TextChanged);
//
// txt_addr
//
this.txt_addr.Location = new System.Drawing.Point(270, 23);
this.txt_addr.Name = "txt_addr";
this.txt_addr.ReadOnly = true;
this.txt_addr.Size = new System.Drawing.Size(138, 21);
this.txt_addr.TabIndex = 12;
this.txt_addr.Text = "";
//
// txt_sex
//
this.txt_sex.Location = new System.Drawing.Point(90, 124);
this.txt_sex.Name = "txt_sex";
this.txt_sex.ReadOnly = true;
this.txt_sex.Size = new System.Drawing.Size(84, 21);
this.txt_sex.TabIndex = 11;
this.txt_sex.Text = "";
//
// txt_qqhm
//
this.txt_qqhm.Location = new System.Drawing.Point(90, 92);
this.txt_qqhm.Name = "txt_qqhm";
this.txt_qqhm.ReadOnly = true;
this.txt_qqhm.Size = new System.Drawing.Size(84, 21);
this.txt_qqhm.TabIndex = 10;
this.txt_qqhm.Text = "";
//
// txt_Xm
//
this.txt_Xm.Location = new System.Drawing.Point(90, 54);
this.txt_Xm.Name = "txt_Xm";
this.txt_Xm.ReadOnly = true;
this.txt_Xm.Size = new System.Drawing.Size(84, 21);
this.txt_Xm.TabIndex = 9;
this.txt_Xm.Text = "";
//
// txt_Xh
//
this.txt_Xh.Location = new System.Drawing.Point(90, 23);
this.txt_Xh.Name = "txt_Xh";
this.txt_Xh.ReadOnly = true;
this.txt_Xh.Size = new System.Drawing.Size(84, 21);
this.txt_Xh.TabIndex = 8;
this.txt_Xh.Text = "";
//
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -