梦见涨洪水把自己冲走:VB简单代码问题 救救小妹拉

来源:百度文库 编辑:高校问答 时间:2024/05/12 10:05:45
Private Sub Command1_Click()
PictureBox1.Visible = False
Label1.Text = CStr(Int(Rnd() * 10))
Label2.Text = CStr(Int(Rnd() * 10))
Label3.Text = CStr(Int(Rnd() * 10))
If (Label1.Text = "7") Or (Label2.Text = "7") Or (Label3.Text = "7") Then
PictureBox1.Visible = True
End If
End Sub

Private Sub Command2_Click()
End
End Sub

第一排是黄的 无法执行 谢谢大哥哥们拉

Label似乎不能用Text,只能用Caption
把所有的LabelX.Text换成LableX.Caption

Private Sub Command1_Click()
Picturebox1.Visible = False
Label1.Caption = CStr(Int(Rnd() * 10))
Label2.Caption = CStr(Int(Rnd() * 10))
Label3.Caption = CStr(Int(Rnd() * 10))
If (Label1.Caption = "7") Or (Label2.Caption = "7") Or (Label3.Caption = "7") Then
Picturebox1.Visible = True
End If
End Sub

Private Sub Command2_Click()
End
End Sub
改成这样 Label 控件 不支持text属性,应为caption属性

二楼正确,顺便提一下end 是结束应用程序运行的语句

楼上正解。

好久不接触VB了,倒数第二排的End是怎么来的?