高手救命!!
我是VB初学者
遇到一个问题,查遍资料找不到解决方法
如我上传的图片,以下为程序代码:
Option Explicit
Private strData As String, strInterest As String
Private Sub chkMusic_Click()
strInterest = strInterest & chkMusic.Caption & "、"
End Sub
Private Sub chkRead_Click()
strInterest = strInterest & chkRead.Caption & "、"
End Sub
Private Sub chkSleep_Click()
strInterest = strInterest & chkSleep.Caption & "、"
End Sub
Private Sub chkSport_Click()
strInterest = strInterest & chkSport.Caption & "、"
End Sub
Private Sub cmdClear_Click()
txtName.Text = ""
optWoman.Enabled = True
optMan.Enabled = True
optMan.Value = 0
optWoman.Value = 0
chkSport.Value = 0
chkRead.Value = 0
chkMusic.Value = 0
chkSleep.Value = 0
strData = "个人资料:" & vbCrLf
strInterest = "爱好:"
lblData.Caption = ""
End Sub
Private Sub cmdOK_Click()
strData = strData & "姓名:" & txtName.Text & vbCrLf
strData = strData & strInterest
lblData.Caption = strData
End Sub
Private Sub Form_Load()
strData = "个人资料:" & vbCrLf
strInterest = "爱好:"
End Sub
Private Sub optMan_Click()
strData = strData & "性别:" & optMan.Caption & vbCrLf
optWoman.Enabled = False
End Sub
Private Sub optWoman_Click()
strData = strData & "性别:" & optWoman.Caption & vbCrLf
optMan.Enabled = False
End Sub
问题是,如何让复选框选取的最后一个“爱好”选项在显示在后面没有“、”,而之前的选项后面有“、”,比如
选择了音乐和读书之后,显示的是“音乐、读书”
在尽量少改动原来代码的情况下做出修改