信抗09级2班徐文兵2009123067实验3多窗口设计及数据处理.doc_第1页
信抗09级2班徐文兵2009123067实验3多窗口设计及数据处理.doc_第2页
信抗09级2班徐文兵2009123067实验3多窗口设计及数据处理.doc_第3页
信抗09级2班徐文兵2009123067实验3多窗口设计及数据处理.doc_第4页
信抗09级2班徐文兵2009123067实验3多窗口设计及数据处理.doc_第5页
已阅读5页,还剩4页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

计算机类课程实验报告院/系:网络工程学院课程名称:Web应用开发技术班级信息对抗09级2班姓名徐文兵学号2009123067实验室号6303日期2011.6.5组号计算机号实验名称多窗口设计及数据处理成绩评定所用软件VS2005教师签名实验内容、要求或目的实验内容:1、设计一个包含有3个窗体的个人信息修改与显示程序。如图3-1所示,在程序启动窗体Forml上放置2个按钮控件Buttonl和Button2,当用户单击不同按钮时将打开不同的窗体Form2和Form3,每个窗体中都显示同一幅的图片及个人信息。在“修改信息”窗体中,可以对文本信息进行修改,在“显示信息”窗体中,只能对文本信息阅读。 2、设计一个的下拉菜单式的界面程序,给每一个菜单项目自定义一个响应。 3、设计一个时间顺序控制程序。实验目的:掌握对象数据传递与处理的方式;掌握多窗口设计的方法;掌握菜单界面程序设计方法;掌握常用的图片加载与显示方法;掌握按钮、标签与文本框的使用方法;理解在应用程序中使用多个窗体的程序设计技巧。实验要求:1 复习上次实验的内容。2 控件位置布局合理。3 控件大小和字体比例适当。4 菜单内容完整,每一项下拉菜单都有明确的事件响应程序。菜单项目的窗口要求占据整个屏幕。5 窗口均要求位居屏幕的中心位置。6. 过程控制时,每一个事件发生时,文件框中要有分别显示事件和分阶段时间累计的功能程序主要算法或源代码1程序代码Form1的代码:using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Windows.Forms;namespace VolumnWin public partial class Form1 : Form public static string name=张三; public static string sex=女; public static int age=21; public static string dept=黄河水院; public static string contact=河南开封; public static string postalcode=475001 ; public static string tel public static string email=zhangsan 126.com ; public Form1() InitializeComponent(); private void button1_Click(object sender, EventArgs e) Form2 fm2=new Form2(); fm2.Show(); button2.Enabled=true; private void button2_Click(object sender, EventArgs e) Form3 fm3=new Form3(); fm3.Show(); Form2的代码:using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Windows.Forms;namespace VolumnWin public partial class Form2 : Form public Form2() InitializeComponent(); private void textBox1_TextChanged(object sender, EventArgs e) 程序主要算法或源代码 F = textBox1.Text; private void textBox2_TextChanged(object sender, EventArgs e) Form1.sex = textBox2.Text; private void textBox3_TextChanged(object sender, EventArgs e) Form1.age = int.Parse(textBox3.Text); private void textBox4_TextChanged(object sender, EventArgs e) Form1.dept = textBox4.Text; private void textBox5_TextChanged(object sender, EventArgs e) Form1.contact = textBox5.Text; private void textBox6_TextChanged(object sender, EventArgs e) Form1.postalcode = textBox6.Text; private void textBox7_TextChanged(object sender, EventArgs e) Form1.tel = textBox7.Text; private void textBox8_TextChanged(object sender, EventArgs e) Form1.email = textBox8.Text; private void Form2_Load(object sender, EventArgs e) textBox1.Text=F; textBox2.Text=Form1.sex; textBox3.Text = Form1.age.ToString(); textBox4.Text=Form1.dept; textBox5.Text=Form1. contact;textBox6.Text=Form1.postalcode; textBox7.Text=Form1.tel; textBox8.Text=Form1.email; Form3的代码:using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Windows.Forms;(写不完时,可另附稿纸。 程序主要算法或源代码namespace VolumnWin public partial class Form3 : Form public Form3() InitializeComponent(); private void Form3_Load(object sender, EventArgs e) textBox1.Text=F; textBox2.Text=Form1.sex; textBox3.Text = Form1.age.ToString(); textBox4.Text=Form1.dept; textBox5.Text=Form1 .contact; textBox6.Text=Form1.postalcode; textBox7.Text=Form1.tel; textBox8.Text=Form1.email; 程序运行结果:点击修改信息后:程序主要算法或源代码修改其中的信息如图所示:点击显示信息后:2.代码:using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Windows.Forms;程序主要算法或源代码namespace ExamSystem public partial class Form1 : Form public Form1() InitializeComponent(); private void 退出xToolStripMenuItem_Click(object sender, EventArgs e) this.Close(); private void 考点代码ToolStripMenuItem_Click(object sender, EventArgs e) MessageBox.Show(fail !); private void 输入考生数据IToolStripMenuItem_Click(object sender, EventArgs e) MessageBox.Show(请在下表输入数据); private void 浏览查阅ToolStripMenuItem_Click(object sender, EventArgs e) MessageBox.Show(连接数据库失败!); private void 帮助FToolStripMenuItem_Click(object sender, EventArgs e) MessageBox.Show(fail!); 运行结果:程序主要算法或源代码3:源码:using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Windows.Forms;namespace TimeOrder public partial class Form1 : Form public Form1() InitializeComponent(); private void Form1_Load(object sender, EventArgs e) /timer1.Enabled = false; int second = 1; private void timer1_Tick(object sender, EventArgs e) second+; if (second = 5 & second = 8 & second = 10 & second 20) second = 0; else label1.Text = 开始执D; private void button1_Click(object sender, EventArgs e) timer1.Enabled = true; label1.Text = 执行D; 程序主要算法或源代码 private void button2_Click(object sender, EventArgs e) if (button2.Text = 暂Y停) timer1.Enabled = false; label1.Text = 暂Y停; button2.Text = 继续?; els

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论