C#之winform基础 listbox控件可以多选

来源:互联网 发布:js call和apply的区别 编辑:程序博客网 时间:2024/06/05 09:17

镇场诗:慈心积善融学习,技术誓为大家学。善心速造多好事,前人栽树后乘凉。我今于此写经验,愿见文者得启发。

——————————————————————————————————————————————————————————



1、关键点


2、效果图





3、代码

using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Threading.Tasks;using System.Windows.Forms;namespace WindowsFormsApplication2{    public partial class Form1 : Form    {        public Form1()        {            InitializeComponent();        }        private void Form1_Load(object sender, EventArgs e)        {            //按住shift可以实现多选            listBox1.SelectionMode = SelectionMode.MultiExtended;        }    }}





——————————————————————————————————————————————————————————
感恩帮助过我的人。博客的精髓在技术部分,更在镇场一诗。
因为心有着无数技术誓愿学的意识,所以着手学习HTML与CSS。
如果您认为有可改进的地方,有错误的地方,请留下评论,我会处理的。
注:如果我的博文无意中侵犯了您的权益,请告知。看到您的告知后,我将及时作出处理。
0 0