vb label caption问题

'form 6
Private Sub Form_Load()
If Form5.Check1.Value = True Then
Label3.Caption = Form5.Check1.Caption
End If
If Form5.Check2.Value = True Then
Label4.Caption = Form5.Check2.Caption
End If
If Form5.Check3.Value = True Then
Label5.Caption = Form5.Check3.Caption
End If
If Form5.Check4.Value = True Then
Label6.Caption = Form5.Check4.Caption
End If
End Sub
有错吗?
或者
'form5
Private Sub Command2_Click()
Form6.Show
If Check1.Value = True Then
Form6.Label3.Caption = "Bruno Mars - When I Was Your Man.mp3"
Else
Form6.Label3.Caption = ""
End If
If Check2.Value = True Then
Form6.Label4.Caption = "Demi Lovato - Let It Go (Single Version).mp3"
Else
Form6.Label4.Caption = ""
End If
If Check3.Value = True Then
Form6.Label5.Caption = "Kristen Bell - Do You Want to Build a Snowman_.mp3"
Else
Form6.Label5.Caption = ""
End If
If Check4.Value = True Then
Form6.Label6.Caption = "Idina Menzel - For the First Time in Forever.mp3"
Else
Form6.Label6.Caption = ""
End If
Unload Form5
End Sub
这样也不行,form6 label控件显示不出来

这是为什么?

你把所有 = True 改为 = 1 就行了。
VB6的CheckBox控件的Value属性的值是0、1、2,不是True和False追问

有一个可以,但是为什么form6的不可以显示?

温馨提示:内容为网友见解,仅供参考
第1个回答  2014-04-11
程序没有问题,应该是CHECK控件没有选中,或者Label控件的Visible属性设置为False了。
相似回答