Windows应用程序开发

整理文档很辛苦,赏杯茶钱您下走!

免费阅读已结束,点击下载阅读编辑剩下 ...

阅读已结束,您可以下载文档离线阅读编辑

资源描述

《C#程序设计》实验报告实验名称:实验五Windows应用程序开发实验日期:班级:学号:姓名:一、实验目的1.掌握建立Windows应用程序的步骤和方法;2.掌握WindowsForms控件的使用;3.掌握常用控件的使用方法。二、实验内容1.P330【实验6-2】。2.P337【实验6-3】。三、实验过程【实验6-2】usingSystem;usingSystem.Collections.Generic;usingSystem.ComponentModel;usingSystem.Data;usingSystem.Drawing;usingSystem.Text;usingSystem.Windows.Forms;namespaceWindowsApplication2{publicpartialclassForm1:Form{publicForm1(){InitializeComponent();}privatevoidForm1_Load(objectsender,EventArgse){}privatevoidcheckBox1_CheckedChanged(objectsender,EventArgse){if(this.checkBox1.Checked==true)this.textBox1.Text=textBox1.Text+checkBox1.Text;}privatevoidcheckBox2_CheckedChanged(objectsender,EventArgse){if(this.checkBox2.Checked==true)this.textBox1.Text=textBox1.Text+checkBox2.Text;}privatevoidradioButton1_CheckedChanged(objectsender,EventArgse){if(this.radioButton1.Checked==true)this.BackColor=Color.Red;}privatevoidradioButton2_CheckedChanged(objectsender,EventArgse){if(this.radioButton2.Checked==true)this.BackColor=Color.Green;}privatevoidradioButton3_CheckedChanged(objectsender,EventArgse){if(this.radioButton3.Checked==true)this.BackColor=Color.Blue;}privatevoidcheckBox3_CheckedChanged(objectsender,EventArgse){if(this.checkBox3.Checked==true)this.textBox1.Text=textBox1.Text+checkBox3.Text;}privatevoidcheckBox4_CheckedChanged(objectsender,EventArgse){if(this.checkBox4.Checked==true)this.textBox1.Text=textBox1.Text+checkBox4.Text;}privatevoidcheckBox6_CheckedChanged(objectsender,EventArgse){if(this.checkBox6.Checked==true)this.textBox1.Text=textBox1.Text+checkBox6.Text;}privatevoidcheckBox5_CheckedChanged(objectsender,EventArgse){if(this.checkBox5.Checked==true)this.textBox1.Text=textBox1.Text+checkBox5.Text;}privatevoidtextBox1_TextChanged(objectsender,EventArgse){}}}【实验6-3】usingSystem;usingSystem.Collections.Generic;usingSystem.ComponentModel;usingSystem.Data;usingSystem.Drawing;usingSystem.Text;usingSystem.Windows.Forms;namespaceWindowsApplication3{publicpartialclassForm1:Form{publicForm1(){InitializeComponent();}privatevoidlabel1_Click(objectsender,EventArgse){}privatevoidbutton1_Click(objectsender,EventArgse){listBox1.Items.Add(书名:+textBox2.Text+,出版社:+comboBox1.Text);textBox2.Text=;}privatevoidbutton2_Click(objectsender,EventArgse){if(listBox1.SelectedIndex!=-1){listBox1.Items.Remove(this.listBox1.SelectedItem);}}}}四、实验总结通过本次实验我掌握了建立Windows应用程序的步骤和方法,学会了WindowsForms控件的使用,通过实验让我对C#课程产生了更加深刻的兴趣。

1 / 4
下载文档,编辑使用

©2015-2020 m.777doc.com 三七文档.

备案号:鲁ICP备2024069028号-1 客服联系 QQ:2149211541

×
保存成功