人机交互用户界面设计实验报告.docx

上传人:b****0 文档编号:9618033 上传时间:2023-05-20 格式:DOCX 页数:23 大小:201.05KB
下载 相关 举报
人机交互用户界面设计实验报告.docx_第1页
第1页 / 共23页
人机交互用户界面设计实验报告.docx_第2页
第2页 / 共23页
人机交互用户界面设计实验报告.docx_第3页
第3页 / 共23页
人机交互用户界面设计实验报告.docx_第4页
第4页 / 共23页
人机交互用户界面设计实验报告.docx_第5页
第5页 / 共23页
人机交互用户界面设计实验报告.docx_第6页
第6页 / 共23页
人机交互用户界面设计实验报告.docx_第7页
第7页 / 共23页
人机交互用户界面设计实验报告.docx_第8页
第8页 / 共23页
人机交互用户界面设计实验报告.docx_第9页
第9页 / 共23页
人机交互用户界面设计实验报告.docx_第10页
第10页 / 共23页
人机交互用户界面设计实验报告.docx_第11页
第11页 / 共23页
人机交互用户界面设计实验报告.docx_第12页
第12页 / 共23页
人机交互用户界面设计实验报告.docx_第13页
第13页 / 共23页
人机交互用户界面设计实验报告.docx_第14页
第14页 / 共23页
人机交互用户界面设计实验报告.docx_第15页
第15页 / 共23页
人机交互用户界面设计实验报告.docx_第16页
第16页 / 共23页
人机交互用户界面设计实验报告.docx_第17页
第17页 / 共23页
人机交互用户界面设计实验报告.docx_第18页
第18页 / 共23页
人机交互用户界面设计实验报告.docx_第19页
第19页 / 共23页
人机交互用户界面设计实验报告.docx_第20页
第20页 / 共23页
亲,该文档总共23页,到这儿已超出免费预览范围,如果喜欢就下载吧!
下载资源
资源描述

人机交互用户界面设计实验报告.docx

《人机交互用户界面设计实验报告.docx》由会员分享,可在线阅读,更多相关《人机交互用户界面设计实验报告.docx(23页珍藏版)》请在冰点文库上搜索。

人机交互用户界面设计实验报告.docx

人机交互用户界面设计实验报告

人机交互用户界面设计实验报告

Lt

D

实验一图形用户界面的设计

一实验目的和要求

1)熟悉图形用户界面的设计原那么

2)利用一种设计工具完成图形化的用户界面设计

二实验内容与步骤

(一)实验内容:

利用常用的设计工具(VC/VB/Delphi/PB等)完成一个通用图形用户界面设计,要遵循界面设计的一般原那么(一致性、快捷方式、提供错误处理),注意颜色的使用,学会使用图标、按钮、屏幕布局、菜单和对话框的设计

(二)实验步骤

1.设计多个对话框,完成填表输入界面的设计,合理使用图标、按钮、颜色;

2.设计不同形式的菜单,完成对不同对话框的调用;

3.提供简单的错误处理、联机帮助

三界面例如

1、登录界面

2、主界面

3代码:

登录界面:

usingSystem;

usingSystem.Drawing;

usingSystem.Collections;

usingSystemponentModel;

usingSystem.Windows.Forms;

usingSystem.Data;

usingSystem.Data.OleDb;

namespaceWealthMIS.user

{

///

///Form1的摘要说明。

///

{

privateSystem.Windows.Forms.ButtonbtClose;

privateSystem.Windows.Forms.TextBoxpassword;

privateSystem.Windows.Forms.Labellabel3;

privateSystem.Windows.Forms.Labellabel2;

privateSystem.Windows.Forms.Labellabel1;

privateSystem.Windows.FormsboBoxcomboName;

///

///必需的设计器变量。

///

privateSystemponentModel.Containercomponents=null;

privateSystem.Windows.Forms.ButtonbtSure;

privateOleDbConnectionoleConnection1=null;

publicLogin()

{

//

//Windows窗体设计器支持所必需的

//

InitializeComponent();

//

//TODO:

在InitializeComponent调用后添加任何构造函数代码

//

}

///

///清理所有正在使用的资源。

///

protectedoverridevoidDispose(booldisposing)

{

if(disposing)

{

if(components!

=null)

{

components.Dispose();

}

}

base.Dispose(disposing);

}

#regionWindows窗体设计器生成的代码

///

///设计器支持所需的方法-不要使用代码编辑器修改

///此方法的内容。

///

privatevoidInitializeComponent()

{

SystemponentModelponentResourceManagerresources=newSystemponentModelponentResourceManager(typeof(Login));

this.btClose=newSystem.Windows.Forms.Button();

this.btSure=newSystem.Windows.Forms.Button();

this.password=newSystem.Windows.Forms.TextBox();

this.label3=newSystem.Windows.Forms.Label();

this.label2=newSystem.Windows.Forms.Label();

this.label1=newSystem.Windows.Forms.Label();

thisboName=newSystem.Windows.FormsboBox();

this.SuspendLayout();

//

//btClose

//

this.btClose.FlatStyle=System.Windows.Forms.FlatStyle.Popup;

this.btClose.ForeColor=System.Drawing.Color.Black;

this.btClose.Location=newSystem.Drawing.Point(159,220);

this.btClose.Name="btClose";

this.btClose.Size=newSystem.Drawing.Size(75,23);

this.btClose.TabIndex=27;

this.btClose.Text="取消";

this.btClose.Click+=newSystem.EventHandler(this.btClose_Click);

//

//btSure

//

this.btSure.FlatStyle=System.Windows.Forms.FlatStyle.Popup;

this.btSure.ForeColor=System.Drawing.Color.Black;

this.btSure.Location=newSystem.Drawing.Point(46,220);

this.btSure.Name="btSure";

this.btSure.Size=newSystem.Drawing.Size(75,23);

this.btSure.TabIndex=26;

this.btSure.Text="确定";

this.btSure.Click+=newSystem.EventHandler(this.btSure_Click);

//

//password

//

this.password.BorderStyle=System.Windows.Forms.BorderStyle.FixedSingle;

this.password.Location=newSystem.Drawing.Point(130,136);

this.password.Name="password";

this.password.PasswordChar='*';

this.password.Size=newSystem.Drawing.Size(100,21);

this.password.TabIndex=25;

this.password.Text="admin";

//

//label3

//

this.label3.Font=newSystem.Drawing.Font("宋体",10.5F,System.Drawing.FontStyle.Bold,System.Drawing.GraphicsUnit.Point,((byte)(134)));

this.label3.ForeColor=System.Drawing.Color.Black;

this.label3.Location=newSystem.Drawing.Point(66,136);

this.label3.Name="label3";

this.label3.Size=newSystem.Drawing.Size(56,23);

this.label3.TabIndex=23;

this.label3.Text="密码";

//

//label2

//

this.label2.Font=newSystem.Drawing.Font("宋体",10.5F,System.Drawing.FontStyle.Bold,System.Drawing.GraphicsUnit.Point,((byte)(134)));

this.label2.ForeColor=System.Drawing.Color.Black;

this.label2.Location=newSystem.Drawing.Point(66,96);

this.label2.Name="label2";

this.label2.Size=newSystem.Drawing.Size(56,23);

this.label2.TabIndex=22;

this.label2.Text="用户名";

//

//label1

//

this.label1.Font=newSystem.Drawing.Font("楷体",18F,System.Drawing.FontStyle.Bold,System.Drawing.GraphicsUnit.Point,((byte)(134)));

this.label1.ForeColor=System.Drawing.Color.Black;

this.label1.Location=newSystem.Drawing.Point(42,48);

this.label1.Name="label1";

this.label1.Size=newSystem.Drawing.Size(208,28);

this.label1.TabIndex=21;

this.label1.Text="理财管理信息系统";

//

//comboName

//

thisboName.Location=newSystem.Drawing.Point(130,96);

thisboName.Name="comboName";

thisboName.Size=newSystem.Drawing.Size(104,20);

thisboName.TabIndex=28;

//

//Login

//

this.AutoScaleBaseSize=newSystem.Drawing.Size(6,14);

this.BackColor=System.Drawing.Color.SeaShell;

this.BackgroundImage=((System.Drawing.Image)(resources.GetObject("$this.BackgroundImage")));

this.ClientSize=newSystem.Drawing.Size(298,287);

this.Controls.Add(thisboName);

this.Controls.Add(this.btClose);

this.Controls.Add(this.btSure);

this.Controls.Add(this.password);

this.Controls.Add(this.label3);

this.Controls.Add(this.label2);

this.Controls.Add(this.label1);

this.MaximizeBox=false;

this.MinimizeBox=false;

this.Name="Login";

this.StartPosition=System.Windows.Forms.FormStartPosition.CenterScreen;

this.Text="登录";

this.Load+=newSystem.EventHandler(this.Login_Load);

this.ResumeLayout(false);

this.PerformLayout();

}

#endregion

///

///应用程序的主入口点。

///

[STAThread]

staticvoidMain()

{

Application.Run(newMainForm());

}

privatevoidbtSure_Click(objectsender,System.EventArgse)

{

try

{

stringsql="selectuName,PWDfromfamilywhereuName='"+thisboName.Text+"'";

if(oleConnection1==null)

oleConnection1=MainForm.getConnection();

OleDbCommandcmd=oleConnection1.CreateCommand();

cmdmandText=sql;

OleDbDataReaderdr=cmd.ExecuteReader();

if(!

dr.Read())

{

MessageBox.Show("无此用户,请重试!

","提示");

dr.Close();

cmd.Dispose();

return;

}

else

{

if(!

dr.GetString

(1).Equals(this.password.Text.ToString()))

{

MessageBox.Show("\n密码错误,请重试!

","提示");

dr.Close();

cmd.Dispose();

return;

}

Menumainmenu=((MainForm)(this.MdiParent)).getMainMenu();

for(inti=0;i<6;i++)

{

mainmenu.MenuItems[i].Visible=true;

}

StatusBarstatusBar=((MainForm)(this.MdiParent)).getStatusBar();

statusBar.Panels[0].Text="当前登录用户";

statusBar.Panels[1].Text=thisboName.Text.Trim();

statusBar.Panels[2].Text=DateTime.Now.ToString();

statusBar.Panels[3].Text="理财管理信息系统";

dr.Close();

cmd.Dispose();

this.Close();

}

}

catch(Exceptionee)

{

MessageBox.Show("\n"+ee.ToString());

}

}

privatevoidbtClose_Click(objectsender,System.EventArgse)

{

this.Close();

}

privatevoidLogin_Load(objectsender,System.EventArgse)

{

if(oleConnection1==null)

oleConnection1=MainForm.getConnection();

//取出系统的所有用户名

//显示在下拉列表,这样用户登录的时候

//选择用户名就可以了,不用再输入用户名了

stringsql="selectuNamefromfamily";

OleDbCommandcmd=newOleDbCommand(sql,oleConnection1);

OleDbDataReaderdr=cmd.ExecuteReader();

intflag=0;

while(dr.Read())

{

thisboName.Items.Add(dr.GetString(0));

flag++;

}

//如果系统存在用户,那么默认选中第一个用户

if(flag>0)

thisboName.SelectedIndex=0;

dr.Close();

cmd.Dispose();

}

}

}

主界面:

usingSystem;

usingSystem.Drawing;

usingSystem.Collections;

usingSystemponentModel;

usingSystem.Windows.Forms;

usingSystem.Data;

usingSystem.Data.OleDb;

namespaceWealthMIS.user

{

///

///Form1的摘要说明。

///

{

privateSystem.Windows.Forms.ButtonbtClose;

privateSystem.Windows.Forms.TextBoxpassword;

privateSystem.Windows.Forms.Labellabel3;

privateSystem.Windows.Forms.Labellabel2;

privateSystem.Windows.Forms.Labellabel1;

privateSystem.Windows.FormsboBoxcomboName;

///

///必需的设计器变量。

///

privateSystemponentModel.Containercomponents=null;

privateSystem.Windows.Forms.ButtonbtSure;

privateOleDbConnectionoleConnection1=null;

publicLogin()

{

//

//Windows窗体设计器支持所必需的

//

InitializeComponent();

//

//TODO:

在InitializeComponent调用后添加任何构造函数代码

//

}

///

///清理所有正在使用的资源。

///

protectedoverridevoidDispose(booldisposing)

{

if(disposing)

{

if(components!

=null)

{

components.Dispose();

}

}

base.Dispose(disposing);

}

#regionWindows窗体设计器生成的代码

///

///设计器支持所需的方法-不要使用代码编辑器修改

///此方法的内容。

///

privatevoidInitializeComponent()

{

SystemponentModelponentResourceManagerresources=newSystemponentModelponentResourceManager(typeof(Login));

this.btClose=newSystem.Windows.Forms.Button();

this.btSure=newSystem.Windows.Forms.Button();

this.password=newSystem.Windows.Forms.TextBox();

this.label3=newSystem.Windows.Forms.Label();

this.label2=newSystem.Windows.Forms.Label();

this.label1=newSystem.Windows.Forms.Label();

thisboName=newSystem.Windows.FormsboBox();

this.SuspendLayout();

//

//btClose

//

this.btClose.FlatStyle=System.Windows.Forms.FlatStyle.Popup;

this.btClose.ForeColor=System.Drawing.Color.Black;

this.btClose.Location=newSystem.Drawing.Point(159,220);

this.btClose.Name="btClose";

this.btClose.Size=newSystem.Drawing.Size(75,23);

this.btClose.TabIndex=27;

this.btClose.Text="取消";

this.btClose.Click+=newSystem.EventHan

展开阅读全文
相关资源
猜你喜欢
相关搜索
资源标签

当前位置:首页 > PPT模板 > 国外设计风格

copyright@ 2008-2023 冰点文库 网站版权所有

经营许可证编号:鄂ICP备19020893号-2