太原理工大学学生公寓管理系统(6)

2019-05-18 22:18

private System.Windows.Forms.Button btAdd; private System.Windows.Forms.TextBox password; private System.Windows.Forms.TextBox name; private System.Windows.Forms.Label label3; private System.Windows.Forms.Label label2; private System.Windows.Forms.Label label1;

public Login()

{

// Windows 窗体设计器支持所必需的 InitializeComponent(); this.oleConnection1=new

OleDbConnection(DormMIS.database.dbConnection.connection); } private void InitializeComponent() { this.btClose = new System.Windows.Forms.Button(); this.btAdd = new System.Windows.Forms.Button(); this.password = new System.Windows.Forms.TextBox(); this.name = new System.Windows.Forms.TextBox(); this.label3 = new System.Windows.Forms.Label(); this.label2 = new System.Windows.Forms.Label(); this.label1 = new System.Windows.Forms.Label(); this.SuspendLayout(); this.btClose.FlatStyle = System.Windows.Forms.FlatStyle.Popup; this.btClose.ForeColor = System.Drawing.Color.Black; this.btClose.Location = new System.Drawing.Point(168, 156); this.btClose.Name = \ this.btClose.TabIndex = 20; this.btClose.Text = \取消\ this.btClose.Click += new System.EventHandler(this.btClose_Click); this.btAdd.FlatStyle = System.Windows.Forms.FlatStyle.Popup; this.btAdd.ForeColor = System.Drawing.Color.Black; this.btAdd.Location = new System.Drawing.Point(48, 156);

26

// password this.password.BorderStyle

System.Windows.Forms.BorderStyle.FixedSingle; this.password.Location = new System.Drawing.Point(128, 116); this.password.Name = \ this.password.PasswordChar = '*'; this.password.TabIndex = 18; this.password.Text = \ // name this.name.BorderStyle

System.Windows.Forms.BorderStyle.FixedSingle; this.name.Location = new System.Drawing.Point(128, 76); this.name.Name = \ this.name.TabIndex = 17; this.name.Text = \

this.btAdd.Name = \this.btAdd.TabIndex = 19; this.btAdd.Text = \确定\

this.btAdd.Click += new System.EventHandler(this.btAdd_Click);

=

=

this.label1.Font = new System.Drawing.Font(\楷体_GB2312\18F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134))); this.label1.ForeColor = System.Drawing.Color.Black; this.label1.Location = new System.Drawing.Point(40, 24); this.label1.Name = \ this.label1.Size = new System.Drawing.Size(208, 28); this.label1.TabIndex = 14; this.label1.Text = \宿舍管理信息系统\ // Login this.AutoScaleBaseSize = new System.Drawing.Size(6, 14); this.BackColor = System.Drawing.Color.Ivory;

27

this.ClientSize = new System.Drawing.Size(296, 198); this.Controls.Add(this.btClose); this.Controls.Add(this.btAdd); this.Controls.Add(this.password); this.Controls.Add(this.name); this.Controls.Add(this.label3); this.Controls.Add(this.label2); this.Controls.Add(this.label1); this.MaximizeBox = false; this.MinimizeBox = false; this.Name = \ this.StartPosition

System.Windows.Forms.FormStartPosition.CenterScreen;

=

this.Text = \登录\ this.ResumeLayout(false); } #endregion /// 应用程序的主入口点。 static void Main() { Application.Run(new Login()); } private void btAdd_Click(object sender, System.EventArgs e) { if(name.Text.Trim()==\ MessageBox.Show(\请输入用户名和密码\提示\ else { oleConnection1.Open(); OleDbCommand cmd=new OleDbCommand(\ string sql=\* from userinfo where UName='\ cmd.CommandText=sql; if (null!=cmd.ExecuteScalar()) { this.Visible=false; //创建并打开主界面 Main main=new Main(); main.Tag=this.FindForm();

28

}

}

}

} else

OleDbDataReader dr; cmd.CommandText=sql; dr=cmd.ExecuteReader(); dr.Read();

main.statusBarPanel2.Text=name.Text.Trim(); main.ShowDialog();

MessageBox.Show(\用户名或密码错误\警告\

}

oleConnection1.Close();

private void btClose_Click(object sender, System.EventArgs e) { this.Close(); }

第七章.系统主窗体设计

主窗体设计是程序操作过程中必不可少的,它是人机交互的重要环节。通过主窗体,用户可以调用系统相关的个子模块。主窗体被分为4个部分:最上面是系统菜单栏,通过它可以调用系统中的所有子窗体;菜单栏下面导航栏,它以按钮的形式使用户能够方便的调用最常用的子窗体;加下来是显示信息的窗体区;最下面是状态栏,用来显示当前登陆的用户名。主窗体如下图:

29

图:

7.1 设计菜单栏和工具栏

菜单栏和工具栏运行效果如图:

图:

图:

30


太原理工大学学生公寓管理系统(6).doc 将本文的Word文档下载到电脑 下载失败或者文档不完整,请联系客服人员解决!

下一篇:107项素质三级定义词典库

相关阅读
本类排行
× 注册会员免费下载(下载后可以自由复制和排版)

马上注册会员

注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信: QQ: