首页 > Windows开发 > 详细

c#练习四单元总结

时间:2017-09-25 00:42:56      阅读:352      评论:0      收藏:0      [点我收藏+]

test4-1

在numericUpDown1中

 trackBar1.Value =(int) numericUpDown1.Value;

在trackBar1中

numericUpDown1.Value = trackBar1.Value;

test4-2

在红绿蓝按钮里执行语句

this.BackColor = Color.FromArgb(hScrollBar1.Value, hScrollBar2.Value, hScrollBar3.Value);

实现窗体背景颜色转变

test4-3与test4-2类似

test4-4

this.ForeColor = Color.FromArgb(hScrollBar1.Value, hScrollBar2.Value, hScrollBar3.Value);

实现窗体前景颜色的改变

test4-5余test4-4类似

test4-6

在trackBar1中

progressBar1.Value =trackBar1.Value ;
this.Opacity = 0.5 + (double)trackBar1.Value / 100;

实现窗体透明度的变化

test4-7

在combox1中实现

switch(comboBox1.SelectedIndex)
{
case 0: radioButton1.Checked = true; break;
case 1: radioButton2.Checked = true; break;
case 2: radioButton3.Checked = true; break;
}

在radioButton1中

if (radioButton1.Checked == true)
comboBox1.SelectedIndex = 0;

radioButton2与3中类似

以此实现combox选择项与radiobutton的同步;

test4-8类似于test4-7

test4-9

在checkBox1中

if (checkBox1.Checked == true)
listBox1.Items.Add("English");
else
listBox1.Items.Remove("English");

在checkBox1与3中与checkbox1类似

实现同过CheckBox复选向listbox添加或删除东西

test4-10

在domainUpDown1中

listBox1.SelectedIndex = domainUpDown1.SelectedIndex;

在listBox1中

domainUpDown1.SelectedIndex = listBox1.SelectedIndex;

实现同步

 

c#练习四单元总结

原文:http://www.cnblogs.com/YuJiaJia/p/7589220.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!