下面是C#界面编程的ListBox和ComboBox控件介绍,主要是关于关于C# ListBox的介绍。
网站建设哪家好,找成都创新互联公司!专注于网页设计、网站建设、微信开发、微信平台小程序开发、集团企业网站建设等服务项目。为回馈新老客户创新互联还提供了建邺免费建站欢迎大家使用!
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Text;
- using System.Windows.Forms;
- namespace ListAndCombo
- {
- public partial class ListAndCombo : Form
- {
- public ListAndCombo()
- {
- InitializeComponent();
- }
- private void Form1_Load(object sender, EventArgs e)
- {
- //初始化设置
- //ListBox 设置
- listBox1.Items.Add("1000 以下");
- listBox1.Items.Add("1001~2000");
- listBox1.Items.Add("2001~3000");
- listBox1.Items.Add("3001~4000");
- listBox1.Items.Add("4001~6000");
- listBox1.Items.Add("6001~8000");
- listBox1.Items.Add("8001~10000");
- listBox1.Items.Add("10000 以上");
- //ComboBox 设置
- comboBox1.Items.Add("身份证");
- comboBox1.Items.Add("学生证");
- comboBox1.Items.Add("教师证");
- comboBox1.Items.Add("军人证");
- comboBox1.Items.Add("护照");
- }
- private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
- {
- label3.Text = listBox1.SelectedItem.ToString();
- }
- private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
- {
- label4.Text = comboBox1.SelectedItem.ToString();
- }
- }
- }
以上就是对编程界面实现的C# ListBox的简单介绍。
【编辑推荐】
新闻名称:界面编程C#ListBox的基本操作
转载来源:http://www.csdahua.cn/qtweb/news48/7198.html
网站建设、网络推广公司-快上网,是专注品牌与效果的网站制作,网络营销seo公司;服务项目有等
声明:本网站发布的内容(图片、视频和文字)以用户投稿、用户转载内容为主,如果涉及侵权请尽快告知,我们将会在第一时间删除。文章观点不代表本网站立场,如需处理请联系客服。电话:028-86922220;邮箱:631063699@qq.com。内容未经允许不得转载,或转载时需注明来源: 快上网