当前位置:编程学习 > VB >>

急急急,请vb高手帮忙解决我这个菜鸟问题

Private Sub Command2_Click()
End
End Sub

Private Sub SPIN_Click()
Image1.Visible = False
Image2.Visible = False
Image3.Visible = False
Label1.Caption = Int(Rnd * 10)
Label2.Caption = Int(Rnd * 10)
Label3.Caption = Int(Rnd * 10)
If (Label1.Caption = 7) Or (Label2.Caption = 7) Or (Label3.Caption = 7) Then
Image1.Visible = True
Image2.Visible = True
Image3.Visible = True
End If
End Sub
生成exe程序后点击command1按钮没反应,怎么回事,请高手解答,谢谢 --------------------编程问答-------------------- command1控件的单击事件内容在哪? --------------------编程问答-------------------- Private Sub Command2_Click() 
End 
End Sub 

Private Sub SPIN_Click() 
Image1.Visible = False 
Image2.Visible = False 
Image3.Visible = False 
Label1.Caption = Int(Rnd * 10) 
Label2.Caption = Int(Rnd * 10) 
Label3.Caption = Int(Rnd * 10) 
If (Label1.Caption = 7) Or (Label2.Caption = 7) Or (Label3.Caption = 7) Then 
Image1.Visible = True 
Image2.Visible = True 
Image3.Visible = True 
End If 
End Sub 
呵呵应该是这样的,不过我编译后还是点击command1没有反应,是怎么回事啊 --------------------编程问答-------------------- Private Sub Command2_Click() 
End 
End Sub 

Private Sub Command1_Click() 
Image1.Visible = False 
Image2.Visible = False 
Image3.Visible = False 
Label1.Caption = Int(Rnd * 10) 
Label2.Caption = Int(Rnd * 10) 
Label3.Caption = Int(Rnd * 10) 
If (Label1.Caption = 7) Or (Label2.Caption = 7) Or (Label3.Caption = 7) Then 
Image1.Visible = True 
Image2.Visible = True 
Image3.Visible = True 
End If 
End Sub 
呵呵应该是这样的,不过我编译后还是点击command1没有反应,是怎么回事啊 --------------------编程问答-------------------- 是啊,你应该在Private Sub Command1_Click() 事件里调用相应函数,或是写相应代码。估计你的单击事件没有实现,或是在代码中将那个关键字写错了。好好检查一下  --------------------编程问答-------------------- 你的Private Sub Command1_Click() 事件,有一个条件判断,因为3个标签是随机显示数值,按你的条件是3个标签中至少有一个是“7”,3个图像控件才会显示。 --------------------编程问答-------------------- 好好查一下控件名称,估计最大的可能是按钮名称和代码没对上。
或者在所有事件上都加断点,单击跟一下程序,看跑哪去了。 --------------------编程问答-------------------- 是不是Command1原来的设定改了 --------------------编程问答-------------------- 单步调试一下,F8 --------------------编程问答-------------------- 你的 command1 的事件代码 Click()、MouseDown()、MouseUp()、MouseMove()、DblClick() 都没写。
你去点它,当然什么反应都不会有。
--------------------编程问答-------------------- 老大,我刚验证过了,可以进行可见性的切换。有一点,你在image控件的picture属性里加载图片了吗,如果没有加载图片,无论如何也不会显示的。 --------------------编程问答-------------------- Caption = "7" --------------------编程问答-------------------- 你没有设定 command  1  的东西了  怎么会有用呢?
补充:VB ,  控件
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,