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

推荐订阅源

酷 壳 – CoolShell
酷 壳 – CoolShell
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
T
Tailwind CSS Blog
有赞技术团队
有赞技术团队
爱范儿
爱范儿
Engineering at Meta
Engineering at Meta
J
Java Code Geeks
雷峰网
雷峰网
WordPress大学
WordPress大学
L
LangChain Blog
D
DataBreaches.Net
The GitHub Blog
The GitHub Blog
博客园 - 三生石上(FineUI控件)
Microsoft Security Blog
Microsoft Security Blog
P
Proofpoint News Feed
腾讯CDC
GbyAI
GbyAI
罗磊的独立博客
Blog — PlanetScale
Blog — PlanetScale
月光博客
月光博客
F
Fortinet All Blogs
Y
Y Combinator Blog
V
V2EX
A
About on SuperTechFans

博客园 - 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]]);
    }          
}