If e.Form.Controls("ListBox1").SelectedIndex >= 0 Then e.Form.Controls("ListBox2").Items.Add(e.Form.Controls("ListBox1").SelectedItem) e.Form.Controls("ListBox1").Items.Remove(e.Form.Controls("ListBox1").SelectedItem) Else MessageBox.Show("请选择一行数据!", "错误", MessageBoxButtons.ok, MessageBoxIcon.Warning) End If