?? frmusermanage.cs
字號:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using ExamCenter.BLCTier;
using System.Data;
namespace ExamCenter.FormTier
{
/// <summary>System.Windows.Forms.Form
/// FrmUserManage 的摘要說明。FrmOpperateLog
/// </summary>
public class FrmUserManage : System.Windows.Forms.Form
{
private System.Windows.Forms.DataGrid dgUsers;
/// <summary>
/// 必需的設計器變量。
/// </summary>
private System.ComponentModel.Container components = null;
//用戶數據集
private DataSet dsUser;
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.GroupBox groupBox2;
private System.Windows.Forms.Button btnSave;
private System.Windows.Forms.Button btnDelUser;
private System.Windows.Forms.Button btnAddUser;
private System.Windows.Forms.TextBox txtUserEname;
private System.Windows.Forms.TextBox txtUserCname;
private System.Windows.Forms.Label lblUserEname;
private System.Windows.Forms.Label lblUserCname;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label lblExit;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.TextBox txtPassword;
private System.Windows.Forms.Button btnEdit;
//用戶表
private DataTable dtUser;
private enum BtnClick{AddClick,DelClick,EditClick,SaveClick};
private BtnClick btnClick = BtnClick.SaveClick;
private DataRow drCurrent;
public FrmUserManage()
{
//
// Windows 窗體設計器支持所必需的
//
InitializeComponent();
//選出數據集與窗體數據網格綁定
MakeBind();
//
// TODO: 在 InitializeComponent 調用后添加任何構造函數代碼
//
}
/// <summary>
/// 清理所有正在使用的資源。
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if(components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Windows Form Designer generated code
/// <summary>
/// 設計器支持所需的方法 - 不要使用代碼編輯器修改
/// 此方法的內容。
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FrmUserManage));
this.dgUsers = new System.Windows.Forms.DataGrid();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.txtPassword = new System.Windows.Forms.TextBox();
this.label2 = new System.Windows.Forms.Label();
this.txtUserEname = new System.Windows.Forms.TextBox();
this.txtUserCname = new System.Windows.Forms.TextBox();
this.lblUserEname = new System.Windows.Forms.Label();
this.lblUserCname = new System.Windows.Forms.Label();
this.btnSave = new System.Windows.Forms.Button();
this.btnDelUser = new System.Windows.Forms.Button();
this.btnAddUser = new System.Windows.Forms.Button();
this.label1 = new System.Windows.Forms.Label();
this.lblExit = new System.Windows.Forms.Label();
this.btnEdit = new System.Windows.Forms.Button();
((System.ComponentModel.ISupportInitialize)(this.dgUsers)).BeginInit();
this.groupBox1.SuspendLayout();
this.groupBox2.SuspendLayout();
this.SuspendLayout();
//
// dgUsers
//
this.dgUsers.BackColor = System.Drawing.SystemColors.HighlightText;
this.dgUsers.BackgroundColor = System.Drawing.SystemColors.ActiveCaptionText;
this.dgUsers.CaptionVisible = false;
this.dgUsers.DataMember = "";
this.dgUsers.Dock = System.Windows.Forms.DockStyle.Fill;
this.dgUsers.HeaderForeColor = System.Drawing.SystemColors.ControlText;
this.dgUsers.Location = new System.Drawing.Point(3, 17);
this.dgUsers.Name = "dgUsers";
this.dgUsers.ReadOnly = true;
this.dgUsers.Size = new System.Drawing.Size(489, 172);
this.dgUsers.TabIndex = 0;
this.dgUsers.CurrentCellChanged += new System.EventHandler(this.dgUsers_CurrentCellChanged);
//
// groupBox1
//
this.groupBox1.BackColor = System.Drawing.Color.Transparent;
this.groupBox1.Controls.Add(this.dgUsers);
this.groupBox1.Location = new System.Drawing.Point(14, 48);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(495, 192);
this.groupBox1.TabIndex = 9;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "用戶列表";
//
// groupBox2
//
this.groupBox2.BackColor = System.Drawing.Color.Transparent;
this.groupBox2.Controls.Add(this.txtPassword);
this.groupBox2.Controls.Add(this.label2);
this.groupBox2.Controls.Add(this.txtUserEname);
this.groupBox2.Controls.Add(this.txtUserCname);
this.groupBox2.Controls.Add(this.lblUserEname);
this.groupBox2.Controls.Add(this.lblUserCname);
this.groupBox2.Location = new System.Drawing.Point(14, 258);
this.groupBox2.Name = "groupBox2";
this.groupBox2.Size = new System.Drawing.Size(495, 56);
this.groupBox2.TabIndex = 10;
this.groupBox2.TabStop = false;
this.groupBox2.Text = "用戶詳細信息";
//
// txtPassword
//
this.txtPassword.Location = new System.Drawing.Point(368, 24);
this.txtPassword.MaxLength = 20;
this.txtPassword.Multiline = true;
this.txtPassword.Name = "txtPassword";
this.txtPassword.Size = new System.Drawing.Size(104, 21);
this.txtPassword.TabIndex = 16;
//
// label2
//
this.label2.Location = new System.Drawing.Point(304, 24);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(64, 23);
this.label2.TabIndex = 15;
this.label2.Text = "密碼:";
this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// txtUserEname
//
this.txtUserEname.Location = new System.Drawing.Point(64, 24);
this.txtUserEname.MaxLength = 20;
this.txtUserEname.Multiline = true;
this.txtUserEname.Name = "txtUserEname";
this.txtUserEname.Size = new System.Drawing.Size(96, 21);
this.txtUserEname.TabIndex = 14;
//
// txtUserCname
//
this.txtUserCname.Location = new System.Drawing.Point(232, 24);
this.txtUserCname.MaxLength = 25;
this.txtUserCname.Multiline = true;
this.txtUserCname.Name = "txtUserCname";
this.txtUserCname.Size = new System.Drawing.Size(80, 21);
this.txtUserCname.TabIndex = 13;
//
// lblUserEname
//
this.lblUserEname.BackColor = System.Drawing.Color.Transparent;
this.lblUserEname.Location = new System.Drawing.Point(8, 24);
this.lblUserEname.Name = "lblUserEname";
this.lblUserEname.Size = new System.Drawing.Size(56, 23);
this.lblUserEname.TabIndex = 12;
this.lblUserEname.Text = "英文名:";
this.lblUserEname.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// lblUserCname
//
this.lblUserCname.BackColor = System.Drawing.Color.Transparent;
this.lblUserCname.Location = new System.Drawing.Point(168, 24);
this.lblUserCname.Name = "lblUserCname";
this.lblUserCname.Size = new System.Drawing.Size(56, 23);
this.lblUserCname.TabIndex = 11;
this.lblUserCname.Text = "中文名:";
this.lblUserCname.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// btnSave
//
this.btnSave.BackColor = System.Drawing.Color.Transparent;
this.btnSave.Location = new System.Drawing.Point(328, 320);
this.btnSave.Name = "btnSave";
this.btnSave.Size = new System.Drawing.Size(72, 23);
this.btnSave.TabIndex = 17;
this.btnSave.Text = "保存";
this.btnSave.UseVisualStyleBackColor = false;
this.btnSave.Click += new System.EventHandler(this.btnSave_Click);
//
// btnDelUser
//
this.btnDelUser.BackColor = System.Drawing.Color.Transparent;
this.btnDelUser.Location = new System.Drawing.Point(224, 320);
this.btnDelUser.Name = "btnDelUser";
this.btnDelUser.Size = new System.Drawing.Size(75, 23);
this.btnDelUser.TabIndex = 16;
this.btnDelUser.Text = "刪除";
this.btnDelUser.UseVisualStyleBackColor = false;
this.btnDelUser.Click += new System.EventHandler(this.btnDelUser_Click);
//
// btnAddUser
//
this.btnAddUser.BackColor = System.Drawing.Color.Transparent;
this.btnAddUser.Location = new System.Drawing.Point(16, 320);
this.btnAddUser.Name = "btnAddUser";
this.btnAddUser.Size = new System.Drawing.Size(75, 23);
this.btnAddUser.TabIndex = 15;
this.btnAddUser.Text = "添加";
this.btnAddUser.UseVisualStyleBackColor = false;
this.btnAddUser.Click += new System.EventHandler(this.btnAddUser_Click);
//
// label1
//
this.label1.BackColor = System.Drawing.Color.Transparent;
this.label1.ForeColor = System.Drawing.Color.White;
this.label1.Location = new System.Drawing.Point(208, 8);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(100, 16);
this.label1.TabIndex = 19;
this.label1.Text = "用 戶 管 理";
this.label1.TextAlign = System.Drawing.ContentAlignment.TopCenter;
//
// lblExit
//
this.lblExit.BackColor = System.Drawing.Color.Transparent;
this.lblExit.ForeColor = System.Drawing.Color.White;
this.lblExit.Location = new System.Drawing.Point(504, 8);
this.lblExit.Name = "lblExit";
this.lblExit.Size = new System.Drawing.Size(16, 8);
this.lblExit.TabIndex = 20;
this.lblExit.TextAlign = System.Drawing.ContentAlignment.TopCenter;
this.lblExit.Click += new System.EventHandler(this.lblExit_Click);
//
// btnEdit
//
this.btnEdit.BackColor = System.Drawing.Color.Transparent;
this.btnEdit.Location = new System.Drawing.Point(120, 320);
this.btnEdit.Name = "btnEdit";
this.btnEdit.Size = new System.Drawing.Size(75, 23);
this.btnEdit.TabIndex = 21;
this.btnEdit.Text = "編輯";
this.btnEdit.UseVisualStyleBackColor = false;
this.btnEdit.Click += new System.EventHandler(this.btnEdit_Click);
//
// FrmUserManage
//
this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
this.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("$this.BackgroundImage")));
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -