vb复选框如何把选中的都让一个文本框显示出来呢?

2025-03-01 16:15:01
推荐回答(2个)
回答1:

Private Sub Command1_Click()
Dim i As Integer
Text1.Text = ""
For i = 0 To Check1.Count - 1
If Check1(i).Value = 1 Then Text1.Text = Text1.Text & Check1(i).Caption & vbCrLf
Next
End Sub

回答2:

Private Sub Check1_Click()
If Check1.Value = 1 Then
Text1.Text = Text1.Text & " " & Check1.Caption

End If
End Sub

Private Sub Check2_Click()
If Check2.Value = 1 Then
Text1.Text = Text1.Text & " " & Check2.Caption
End If

End Sub

Private Sub Check3_Click()
If Check3.Value = 1 Then
Text1.Text = Text1.Text & " " & Check3.Caption
End If
End Sub

是不是这样子啊