您好,欢迎访问三七文档
当前位置:首页 > 行业资料 > 国内外标准规范 > 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#课程产生了更加深刻的兴趣。
本文标题:Windows应用程序开发
链接地址:https://www.777doc.com/doc-4692325 .html