listBox1.Items.Remove(listBox1.Items[i]);

解决方案 »

  1.   

    listBox1.Items.Remove(listBox1.Items[i]);
    同意楼上 
    有数据库也需要删除
      

  2.   

    数据库的话只需要取出特定的标记,执行delete语句即可。
      

  3.   

    删除  手动添加列表中的数据
       数据库 delete from [table] where 
      
      

  4.   

    listBox1.Items.Remove(listBox1.SelectedItem);这样就OK
      

  5.   

    listView1.Items[0].Remove();
    删除行号为0的行
      

  6.   

    是不是要这种效果
     第一行    修改  删除
     第二行    修改  删除
     第三行    修改  删除
    在页面里面添加一个LinkButton 控件  
    <asp:LinkButton ID="lbtn_dalete" runat="server" CssClass="btnDelete" Text="删除" CommandName="newsid"
                                                CommandArgument="<%# Eval(newsid)
    %>" OnCommand="lbtn_dalete_Command"></asp:LinkButton>
    在后台就是添加啦lbtn_dalete_Command事件 
    protected void lbtn_dalete_Command(object sender, CommandEventArgs e)
    {
       int newsid=Convert.ToInt32(e.CommandArgument.ToString());
        然后调用BLL 层的业务逻辑方法进行delete 删除操作;
        这是首写的 可能大小写有点错误  自己敲下就知道啦
         执行delete 操作可能返回一个标示符号,,(各人方法不同,也许你方法没返回值)
        成功就要重新进行绑定数据源  例如:bindlist();
        或者try{}catch一下 应该不用多说啦 
    }
      

  7.   

    http://www.tctl.com.cn/accp/1490/1492/122041.html
      

  8.   

     if (listbox1.SelectedItems.Count == 0)
     {MessageBox.Show("你没有选择任何一行", "操作提示", MessageBoxButtons.OK, MessageBoxIcon.Information);}
    else
    { DialogResult choice = MessageBox.Show("确定要删除该行吗?", "操作警告!",MessageBoxButtons.YesNo,MessageBoxIcon.Warning);
    //如果确定删除,则执行删除操作
    if (choice == DialogResult.Yes)
    { string sql = string.Format("DELETE FROM 数据库名 WHERE 条件",(int)listbox1.SelectedItems[0].Tag);
    SqlCommand command = new SqlCommand(sql,DBHelper.connection);
     int result = 0;//操作结果
     try
    {DBHelper.connection.Open();
    result = command.ExecuteNonQuery();}
     catch (Exception ex)
    {MessageBox.Show(ex.Message);}
     finally 
    {DBHelper.connection.Close();}
    if (result < 1)
    {MessageBox.Show("删除失败", "操作结果", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);}
    else
    { MessageBox.Show("删除成功","操作结果",MessageBoxButtons.OK,MessageBoxIcon.Information);
     FillListView();
    }