📄 frmtongxin.cs
字号:
this.dbgBooksDt.Location = new System.Drawing.Point(8, 64);
this.dbgBooksDt.Name = "dbgBooksDt";
this.dbgBooksDt.Size = new System.Drawing.Size(400, 168);
this.dbgBooksDt.TabIndex = 0;
this.dbgBooksDt.Click += new System.EventHandler(this.dbgBooksDt_Click);
//
// pdocOrderDetails
//
this.pdocOrderDetails.PrintPage += new System.Drawing.Printing.PrintPageEventHandler(this.pdocOrderDetails_PrintPage);
//
// pageSetupDialog1
//
this.pageSetupDialog1.Document = this.pdocOrderDetails;
//
// printPreviewDialog1
//
this.printPreviewDialog1.AutoScrollMargin = new System.Drawing.Size(0, 0);
this.printPreviewDialog1.AutoScrollMinSize = new System.Drawing.Size(0, 0);
this.printPreviewDialog1.ClientSize = new System.Drawing.Size(400, 300);
this.printPreviewDialog1.Document = this.pdocOrderDetails;
this.printPreviewDialog1.Enabled = true;
this.printPreviewDialog1.Icon = ((System.Drawing.Icon)(resources.GetObject("printPreviewDialog1.Icon")));
this.printPreviewDialog1.Location = new System.Drawing.Point(66, 90);
this.printPreviewDialog1.MinimumSize = new System.Drawing.Size(375, 250);
this.printPreviewDialog1.Name = "printPreviewDialog1";
this.printPreviewDialog1.TransparencyKey = System.Drawing.Color.Empty;
this.printPreviewDialog1.Visible = false;
//
// printDialog1
//
this.printDialog1.Document = this.pdocOrderDetails;
//
// groupBox1
//
this.groupBox1.BackColor = System.Drawing.SystemColors.Desktop;
this.groupBox1.Controls.Add(this.btnAgain);
this.groupBox1.Controls.Add(this.txtEmail);
this.groupBox1.Controls.Add(this.label2);
this.groupBox1.Controls.Add(this.txtAdd);
this.groupBox1.Controls.Add(this.label1);
this.groupBox1.Controls.Add(this.btnDel);
this.groupBox1.Controls.Add(this.btnUpdata);
this.groupBox1.Controls.Add(this.btnIns);
this.groupBox1.Controls.Add(this.txtYouzheng);
this.groupBox1.Controls.Add(this.txtTel);
this.groupBox1.Controls.Add(this.txtQQ);
this.groupBox1.Controls.Add(this.txtJiguan);
this.groupBox1.Controls.Add(this.txtAge);
this.groupBox1.Controls.Add(this.txtname);
this.groupBox1.Controls.Add(this.lblNo4);
this.groupBox1.Controls.Add(this.lblNo3);
this.groupBox1.Controls.Add(this.lblNo2);
this.groupBox1.Controls.Add(this.lblNo1);
this.groupBox1.Controls.Add(this.lblpassword);
this.groupBox1.Controls.Add(this.lblname);
this.groupBox1.Font = new System.Drawing.Font("黑体", 10.5F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.groupBox1.ForeColor = System.Drawing.Color.Blue;
this.groupBox1.Location = new System.Drawing.Point(8, 16);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(336, 272);
this.groupBox1.TabIndex = 2;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "操作";
//
// btnAgain
//
this.btnAgain.Font = new System.Drawing.Font("华文细黑", 10.5F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.btnAgain.ForeColor = System.Drawing.Color.DarkViolet;
this.btnAgain.Location = new System.Drawing.Point(8, 240);
this.btnAgain.Name = "btnAgain";
this.btnAgain.Size = new System.Drawing.Size(56, 24);
this.btnAgain.TabIndex = 69;
this.btnAgain.Text = "重置";
this.btnAgain.Click += new System.EventHandler(this.btnAgain_Click);
//
// txtEmail
//
this.txtEmail.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.txtEmail.ForeColor = System.Drawing.Color.Magenta;
this.txtEmail.Location = new System.Drawing.Point(80, 144);
this.txtEmail.MaxLength = 30;
this.txtEmail.Name = "txtEmail";
this.txtEmail.Size = new System.Drawing.Size(248, 23);
this.txtEmail.TabIndex = 68;
this.txtEmail.Text = "";
//
// label2
//
this.label2.Font = new System.Drawing.Font("楷体_GB2312", 10.5F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.label2.ForeColor = System.Drawing.Color.Blue;
this.label2.Location = new System.Drawing.Point(8, 152);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(64, 16);
this.label2.TabIndex = 67;
this.label2.Text = "E-mail:";
this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// txtAdd
//
this.txtAdd.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.txtAdd.ForeColor = System.Drawing.Color.Magenta;
this.txtAdd.Location = new System.Drawing.Point(80, 192);
this.txtAdd.MaxLength = 50;
this.txtAdd.Multiline = true;
this.txtAdd.Name = "txtAdd";
this.txtAdd.Size = new System.Drawing.Size(248, 21);
this.txtAdd.TabIndex = 66;
this.txtAdd.Text = "";
//
// label1
//
this.label1.Font = new System.Drawing.Font("楷体_GB2312", 10.5F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.label1.ForeColor = System.Drawing.Color.Blue;
this.label1.Location = new System.Drawing.Point(8, 192);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(64, 16);
this.label1.TabIndex = 65;
this.label1.Text = "地址:";
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// btnDel
//
this.btnDel.Font = new System.Drawing.Font("华文细黑", 10.5F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.btnDel.ForeColor = System.Drawing.Color.DarkViolet;
this.btnDel.Location = new System.Drawing.Point(168, 240);
this.btnDel.Name = "btnDel";
this.btnDel.Size = new System.Drawing.Size(64, 24);
this.btnDel.TabIndex = 64;
this.btnDel.Text = "删除";
this.btnDel.Click += new System.EventHandler(this.btnDel_Click);
//
// btnUpdata
//
this.btnUpdata.Font = new System.Drawing.Font("华文细黑", 10.5F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.btnUpdata.ForeColor = System.Drawing.Color.DarkViolet;
this.btnUpdata.Location = new System.Drawing.Point(80, 240);
this.btnUpdata.Name = "btnUpdata";
this.btnUpdata.Size = new System.Drawing.Size(56, 24);
this.btnUpdata.TabIndex = 63;
this.btnUpdata.Text = "更新";
this.btnUpdata.Click += new System.EventHandler(this.btnUpdata_Click);
//
// btnIns
//
this.btnIns.Font = new System.Drawing.Font("华文细黑", 10.5F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.btnIns.ForeColor = System.Drawing.Color.DarkViolet;
this.btnIns.Location = new System.Drawing.Point(256, 240);
this.btnIns.Name = "btnIns";
this.btnIns.Size = new System.Drawing.Size(72, 24);
this.btnIns.TabIndex = 62;
this.btnIns.Text = "插入";
this.btnIns.Click += new System.EventHandler(this.btnIns_Click);
//
// txtYouzheng
//
this.txtYouzheng.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.txtYouzheng.ForeColor = System.Drawing.Color.Magenta;
this.txtYouzheng.Location = new System.Drawing.Point(240, 96);
this.txtYouzheng.MaxLength = 7;
this.txtYouzheng.Name = "txtYouzheng";
this.txtYouzheng.Size = new System.Drawing.Size(88, 23);
this.txtYouzheng.TabIndex = 61;
this.txtYouzheng.Text = "";
//
// txtTel
//
this.txtTel.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.txtTel.ForeColor = System.Drawing.Color.Magenta;
this.txtTel.Location = new System.Drawing.Point(80, 96);
this.txtTel.MaxLength = 15;
this.txtTel.Name = "txtTel";
this.txtTel.Size = new System.Drawing.Size(88, 23);
this.txtTel.TabIndex = 60;
this.txtTel.Text = "";
//
// txtQQ
//
this.txtQQ.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.txtQQ.ForeColor = System.Drawing.Color.Magenta;
this.txtQQ.Location = new System.Drawing.Point(240, 56);
this.txtQQ.MaxLength = 12;
this.txtQQ.Name = "txtQQ";
this.txtQQ.Size = new System.Drawing.Size(88, 23);
this.txtQQ.TabIndex = 59;
this.txtQQ.Text = "";
//
// txtJiguan
//
this.txtJiguan.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.txtJiguan.ForeColor = System.Drawing.Color.Magenta;
this.txtJiguan.Location = new System.Drawing.Point(80, 56);
this.txtJiguan.MaxLength = 4;
this.txtJiguan.Name = "txtJiguan";
this.txtJiguan.Size = new System.Drawing.Size(88, 23);
this.txtJiguan.TabIndex = 58;
this.txtJiguan.Text = "";
this.txtJiguan.TextChanged += new System.EventHandler(this.txtJiguan_TextChanged);
//
// txtAge
//
this.txtAge.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.txtAge.ForeColor = System.Drawing.Color.Magenta;
this.txtAge.Location = new System.Drawing.Point(240, 16);
this.txtAge.MaxLength = 3;
this.txtAge.Name = "txtAge";
this.txtAge.Size = new System.Drawing.Size(88, 23);
this.txtAge.TabIndex = 57;
this.txtAge.Text = "";
//
// txtname
//
this.txtname.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.txtname.ForeColor = System.Drawing.Color.Magenta;
this.txtname.Location = new System.Drawing.Point(80, 24);
this.txtname.MaxLength = 6;
this.txtname.Name = "txtname";
this.txtname.Size = new System.Drawing.Size(88, 23);
this.txtname.TabIndex = 56;
this.txtname.Text = "";
this.txtname.TextChanged += new System.EventHandler(this.txtname_TextChanged);
//
// lblNo4
//
this.lblNo4.Font = new System.Drawing.Font("楷体_GB2312", 10.5F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.lblNo4.ForeColor = System.Drawing.Color.Blue;
this.lblNo4.Location = new System.Drawing.Point(168, 96);
this.lblNo4.Name = "lblNo4";
this.lblNo4.Size = new System.Drawing.Size(80, 24);
this.lblNo4.TabIndex = 55;
this.lblNo4.Text = "邮政编码:";
this.lblNo4.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// lblNo3
//
this.lblNo3.Font = new System.Drawing.Font("楷体_GB2312", 10.5F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.lblNo3.ForeColor = System.Drawing.Color.Blue;
this.lblNo3.Location = new System.Drawing.Point(8, 96);
this.lblNo3.Name = "lblNo3";
this.lblNo3.Size = new System.Drawing.Size(80, 24);
this.lblNo3.TabIndex = 54;
this.lblNo3.Text = "联系电话:";
this.lblNo3.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// lblNo2
//
this.lblNo2.Font = new System.Drawing.Font("楷体_GB2312", 10.5F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.lblNo2.ForeColor = System.Drawing.Color.Blue;
this.lblNo2.Location = new System.Drawing.Point(176, 56);
this.lblNo2.Name = "lblNo2";
this.lblNo2.Size = new System.Drawing.Size(64, 24);
this.lblNo2.TabIndex = 53;
this.lblNo2.Text = "QQ号码:";
this.lblNo2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// lblNo1
//
this.lblNo1.Font = new System.Drawing.Font("楷体_GB2312", 10.5F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.lblNo1.ForeColor = System.Drawing.Color.Blue;
this.lblNo1.Location = new System.Drawing.Point(16, 64);
this.lblNo1.Name = "lblNo1";
this.lblNo1.Size = new System.Drawing.Size(56, 24);
this.lblNo1.TabIndex = 52;
this.lblNo1.Text = "籍贯:";
this.lblNo1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// lblpassword
//
this.lblpassword.Font = new System.Drawing.Font("楷体_GB2312", 10.5F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.lblpassword.ForeColor = System.Drawing.Color.Blue;
this.lblpassword.Location = new System.Drawing.Point(176, 24);
this.lblpassword.Name = "lblpassword";
this.lblpassword.Size = new System.Drawing.Size(56, 24);
this.lblpassword.TabIndex = 51;
this.lblpassword.Text = "年龄:";
this.lblpassword.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// lblname
//
this.lblname.Font = new System.Drawing.Font("楷体_GB2312", 10.5F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.lblname.ForeColor = System.Drawing.Color.Blue;
this.lblname.Location = new System.Drawing.Point(16, 24);
this.lblname.Name = "lblname";
this.lblname.Size = new System.Drawing.Size(56, 24);
this.lblname.TabIndex = 50;
this.lblname.Text = "姓名:";
this.lblname.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// frmTongxin
//
this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
this.BackColor = System.Drawing.SystemColors.Desktop;
this.ClientSize = new System.Drawing.Size(776, 302);
this.Controls.Add(this.groupBox1);
this.Controls.Add(this.groupBox2);
this.ForeColor = System.Drawing.Color.Blue;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Name = "frmTongxin";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "通信录";
this.Load += new System.EventHandler(this.frmscore_Load);
this.groupBox2.ResumeLayout(false);
this.groupBox3.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.dbgBooksDt)).EndInit();
this.groupBox1.ResumeLayout(false);
this.ResumeLayout(false);
}
#endregion
private void ShowDataGird()
{
string strConnection="Provider=Microsoft.Jet.OLEDB.4.0;";
strConnection+=@"Data Source=Student.mdb";
objSqlConn=new OleDbConnection(strConnection);
objSqlConn.Open();
//初始化DataAdapter
objSqlDataAdapter=new OleDbDataAdapter();
objSqlDataAdapter.SelectCommand=new OleDbCommand("select * from Tongxuelu",objSqlConn);
objDataSet=new DataSet();
//填充数据集
objSqlDataAdapter.Fill(objDataSet,"Tongxuelu");
this.dbgBooksDt.SetDataBinding(objDataSet,"Tongxuelu");
objSqlConn.Close();
if(this.objDataSet.Tables["Tongxuelu"].Rows.Count==0)
{
this.btnUpdata.Enabled=false;
this.btnDel.Enabled=false;
}
else
{
this.btnUpdata.Enabled=true;
this.btnDel.Enabled=true;
}
}
private void frmscore_Load(object sender, System.EventArgs e)
{
//初始化连接
string strConnection="Provider=Microsoft.Jet.OLEDB.4.0;";
strConnection+=@"Data Source=Student.mdb";
objSqlConn=new OleDbConnection(strConnection);
objSqlConn.Open();
//初始化DataAdapter
objSqlDataAdapter=new OleDbDataAdapter();
objSqlDataAdapter.SelectCommand=new OleDbCommand("select * from Tongxuelu",objSqlConn);
objDataSet=new DataSet();
//填充数据集
objSqlDataAdapter.Fill(objDataSet,"Tongxuelu");
this.dbgBooksDt.SetDataBinding(objDataSet,"Tongxuelu");
//如果行数为0,则禁用“更新”和“删除”按钮
if(objDataSet.Tables["Tongxuelu"].Rows.Count == 0)
{
btnUpdata.Enabled = false;
btnDel.Enabled = false;
}
objSqlConn.Close();
user myUser = user.InitUser();
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -