首页 > Windows开发 > 详细

控件--ComboBox;RadionButton;Timer;DataGridView

时间:2014-07-13 20:13:52      阅读:501      评论:0      收藏:0      [点我收藏+]

ComboBox:组合框---属性:

Text:选中的值

Items:组合框中的项

Add:添加单个的值

AddRange:添加多个的值

SelectedIndex:索引值  

SelectedValue:隐藏值                                                                  

DropDownStyle:下拉框样式

Remove:删除

Clear:清除

例:

//选中文本框的值

var txt=this.ComboBox.Text;

//添加单个的值

this.ComboBox.Add("小黑");

//添加多个的值

string[]strs={"小黑","小米"};

this.ComboBox.AddRange("小黑");

//选中第一个值

this.ComboBox.SelectedIndex=0;

//隐藏值

this.ComboBox.SelectedValue=;

//下拉框样式设置为只读

this.ComboBox.DropDownStyle=ComboBoxStyle.DropDownList;

//删除选中的值

this.ComboBox = Items.Remove(txt);

//清除选中的值

this.ComboBox = Items.Clear(txt);

---事件:SelectedIndexChanged:下拉框列表发生改变时触发的事件

 

RadionButton:单选按钮---属性:

Checked:是否选中

例:

if(this.RadionButton.Checked){

  MessagerBox.Show("选中");

}else{

  MessagerBox.Show("没选中");

}                                                                                             

Timer:时钟控件---属性:

InterVal:时间间隔,单位是毫秒

Enavles:开启时钟

例:

//获取当前时间

DateTime dt=DateTime.Now;

//开启时钟

this.timerl.Start();

//设置时间间隔

this.timerl.InterVal=1000;

//停止时钟

this.timerl.stop();

 

DataGridView:黑道

绑定值:this.DataGridView.DataSource=table;

选中值:this.DataGridView.SelectedItems[0].Cells[0].Valus.tostring();

 

 

控件--ComboBox;RadionButton;Timer;DataGridView,布布扣,bubuko.com

控件--ComboBox;RadionButton;Timer;DataGridView

原文:http://www.cnblogs.com/denglj/p/3841041.html

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