CheckedListBox问题
先将textbox控件的multiline属性设置为truePrivate Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim i As Integer
For i = 1 To 20
CheckedListBox1.Items.Add("这是第" & CStr(i) & "项")
Next
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim i As Integer
For i = 0 To CheckedListBox1.CheckedItems.Count - 1
TextBox1.Text += (CheckedListBox1.CheckedItems(i) & ControlChars.CrLf)
Next
End Sub
如何把添加的数据用符号分开?
比如把
这是第1项 这是第2项 修改为
'这是第1项','这是第2项',直至结束