首页
IT
登录
6mi
u
盘
搜
搜 索
IT
C# 代码写ComboBox控件
C# 代码写ComboBox控件
xiaoxiao
2021-03-25
95
ComboBox控件
1 申明
private
System.Windows.Forms.
ComboBox
comboBox_info;
2 实例化
this
.comboBox_info =
new
System.Windows.Forms.
ComboBox
();
3 设置
//
// comboBox_info
//
this
.comboBox_info.Location =
new
System.Drawing.
Point
(200, 100);
this
.comboBox_info.Name =
"comboBox_info"
;
this
.comboBox_info.Size =
new
System.Drawing.
Size
(100, 30);
this
.comboBox_info.TabIndex = 1;
this
.comboBox_info.Items.Add(
"this is one"
);
this
.comboBox_info.Items.Add(
"this is two"
);
this
.comboBox_info.Items.Add(
"this is three"
);
this
.comboBox_info.Items.Add(
"this is four"
);
this
.comboBox_info.Items.Add(
"this is five"
);
this
.comboBox_info.SelectedIndex = 0;
this
.comboBox_info.Text =
"0"
;
4 加入窗口
this
.Controls.Add(
this
.comboBox_info);
转载请注明原文地址: https://ju.6miu.com/read-22447.html
技术
最新回复
(
0
)