惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

C
Check Point Blog
美团技术团队
Microsoft Security Blog
Microsoft Security Blog
大猫的无限游戏
大猫的无限游戏
T
Tailwind CSS Blog
G
Google Developers Blog
博客园 - 聂微东
爱范儿
爱范儿
博客园 - 叶小钗
J
Java Code Geeks
月光博客
月光博客
博客园 - Franky
MongoDB | Blog
MongoDB | Blog
The Cloudflare Blog
宝玉的分享
宝玉的分享
博客园 - 【当耐特】
Microsoft Azure Blog
Microsoft Azure Blog
The GitHub Blog
The GitHub Blog
小众软件
小众软件
WordPress大学
WordPress大学
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Vercel News
Vercel News
Y
Y Combinator Blog
量子位

博客园 - NanKe Sir's Blog

设置RDLC报表参数 - NanKe Sir's Blog 用SQL语句查询累计值 C#调用存储过程通用类3 Winform控件拖动 TreeView查找 在 DataGridView 中实现类似 Ctrl + F 的查找功能 正则表达式使用 Collapsing margins CSS基础 打开 mdi 窗体的子窗体 计算24点代码javascript 对数据库表进行简单的增删改查操作的通用类 C#存储过程调用 SQL连接查询AND和WHERE的不同 我为什么憎恨Framework SQL选择所最近一条记录 Sql Server 日期格式转换 INSERT INTO SELECT FROM 的用法 无法将输入 xml 文件内容转换为数据集
从绑定了数据源的 ListBox 中删除多个选定项
NanKe Sir's Blog · 2008-10-13 · via 博客园 - NanKe Sir's Blog

private void unSelect(ListBox lstBx, BindingSource bindSrc) {
  
int[] selectedIndexs = new int[lstBx.SelectedItems.Count];
    
for (int i = lstBx.Items.Count - 1, j = 0; i >= 0; i--) {
      
if (lstBx.GetSelected(i)) {
        selectedIndexs[j
++= i;
      }
    }
    
for (int i = 0; i < selectedIndexs.Length; i++) {
      bindSrc.Remove(lstBx.Items[selectedIndexs[i]]);
    }          
}