预览加载中,请您耐心等待几秒...
1/10
2/10
3/10
4/10
5/10
6/10
7/10
8/10
9/10
10/10

亲,该文档总共99页,到这已经超出免费预览范围,如果喜欢就直接下载吧~

如果您无法下载资料,请参考说明:

1、部分资料下载需要金币,请确保您的账户上有足够的金币

2、已购买过的文档,再次下载不重复扣费

3、资料包下载后请先用软件解压,在使用对应软件打开

桌面应用程序开发的一般步骤表单的基本方法控件的作用控件的操作Button控件TextBox控件RichTextBox控件else{if((name=="admin")&&(pass=="123")){Form2f2=newForm2();f2.Show();this.Hide();}else{MessageBox.Show("用户名或者密码错误,请重新登录");textBox1.Text="";textBox2.Text="";textBox1.Focus();}}}}选择类控件CheckedListBoxprivatevoidbutton1_Click(objectsender,EventArgse){if(this.checkBox1.Checked==true){this.checkedListBox1.Items.Add(checkBox1.Text);}if(this.checkBox2.Checked==true){this.checkedListBox1.Items.Add(checkBox2.Text);}if(this.checkBox3.Checked==true){this.checkedListBox1.Items.Add(checkBox3.Text);}if(checkBox4.Checked==true){this.checkedListBox1.Items.Add(checkBox4.Text);}}privatevoidbutton1_Click(objectsender,EventArgse){if(listBox1.Items.Count<=0){MessageBox.Show("请添加项目");}else{if(listBox1.SelectedItems.Count<=0){MessageBox.Show("请选择项目");}else{listBox2.Items.Add(listBox1.SelectedItem.ToString());listBox1.Items.Remove(listBox1.SelectedItem);}}}容器控件privatevoidbutton1_Click(objectsender,EventArgse){stringstrName="功能"+Convert.ToString(this.tabControl1.TabPages.Count+1);stringstrTap="tabPage"+Convert.ToString(this.tabControl1.TabPages.Count);this.tabControl1.TabPages.Add(strTap,strName);}编写计算机程序的代码privatevoidbutton1_Click(objectsender,EventArgse){try{doublea1=double.Parse(textBox1.Text);doublea2=double.Parse(textBox2.Text);doublea3=0;if(boBox1.Text.ToString()=="+"){a3=a1+a2;}if(boBox1.Text.ToString()=="-"){a3=a1-a2;}if(boBox1.Text.ToString()=="*"){a3=a1*a2;}组件privatevoidtimer1_Tick(objectsender,EventArgse){button1.Enabled=false;}privatevoidForm1_Load(objectsender,EventArgse){this.timer1.Interval=1000;this.timer1.Enabled=true;}其他常用控件应用TreeView控件应用PictureBox控件菜单栏、工具栏和状态栏设计工具栏状态栏消息对话框privatevoidbntAsterisk_Click(objectsender,EventArgse){MessageBox.Show("内存不足","系统提示",MessageBoxButtons.OK,MessageBoxIcon.Asterisk);}privatevoidbntError_Click(objectsender,EventArgse){MessageBox.Show("系统错误","系统提示",MessageBoxButtons.OK,MessageBoxIcon.Error);}privatevoidbntExclamation_Click(objectsender,EventArgse){MessageBox.Show("危险品","有情提示",Message