请教如下图的问题:如何在CheckedComboBox中多选后,在“用户名”的Label中同样出现多选的人名
以下是在CheckedComboBox1的事件中的Click中设置的代码,感觉代码有问题,只能选择1人,不能选择多人到“用户名”的Label中,但不知怎样改
If e.Form.Controls("TextBox1").Value = Nothing Then
Dim lst As WinForm.CheckedComboBox = e.Form.Controls("CheckedComboBox1")
If lst.SelectedIndex >=0 Then
Dim s As String = lst.SelectedItem
e.Form.Controls("用户名").Text = s.Remove(s.IndexOf("(")) '删除"("之后的字符
End If
Else
Dim lst As WinForm.CheckedComboBox = e.Form.Controls("CheckedComboBox1")
If lst.SelectedIndex >=0 Then
Dim s As String = lst.SelectedItem
If s.Remove(s.IndexOf("(")) <> e.Form.Controls("用户名").Text Then
If MessageBox.Show("该操作会清空记录,是否继续?","提示",MessageBoxButtons.YesNo,MessageBoxIcon.Question) = DialogResult.Yes Then
e.Form.Controls("TextBox1").Value = Nothing
e.Form.Controls("TextBox3").Value = Nothing
e.Form.Controls("用户名").Text = s.Remove(s.IndexOf("(")) '删除"("之后的字符
End If
End If
End If
End If

此主题相关图片如下:未标题-1.jpg