C#-如何清除ListBox的值

| 如何清除ListBox的值,例如
    private void clearvalues_Click(object sender, EventArgs e)
    {
        <Wipe ListBox1 Values>
    }
    
已邀请:
        我假设您正在使用WinForms
listBox.Items.Clear();
    
        用这个:
   listBox.Items.Clear();
    
        试试这个
ListBox1.ClearSelection();
    

要回复问题请先登录注册