Private Sub Command1_Click()
Dim name As String * 10
Dim sex As String * 2
Dim lab As String
Dim lik As String
If Text1.Text <> "" Then
name = Text1.Text
Else
MsgBox "请输入姓名!"
Text1.SetFocus
End If
lab = "姓名:" & vbCrLf & name & vbCrLf
If Option1 Then
sex = "男"
Else
sex = "女"
End If
lab = lab & "性别:" & sex & vbCrLf & vbCrLf & "爱好:" & vbCrLf
If Check1.Value = 1 Then lik = "上网" & vbCrLf
If Check2.Value = 1 Then lik = lik & "旅游" & vbCrLf
If Check3.Value = 1 Then lik = lik & "读书" & vbCrLf
If Check4.Value = 1 Then lik = lik & "书法" & vbCrLf
If Check5.Value = 1 Then lik = lik & "打球" & vbCrLf
If Check6.Value = 1 Then lik = lik & "游泳" & vbCrLf
Label2.Caption = lab & lik
Text1.SetFocus
Text1.SelStart = 0
Text1.SelLength = Len(Text1.Text)
End Sub
Private Sub Text1_Change()
Option1.Value = True
Check1.Value = 0
Check2.Value = 0
Check3.Value = 0
Check4.Value = 0
Check5.Value = 0
Check6.Value = 0
Label2.Caption = ""
End Sub
请问前边定义NAME和SEX时为什么加*10和*2
lab = "姓名:" & vbCrLf & name & vbCrLf,这一句为什么那么多&VBCRLF