请问在VB中这个程序的代码怎么写?
先是两个标签都不可见,单击窗体后标签1变为可见,标签2不可见.再次单击窗体,两个都变成可见,再次单击窗体,标签1不可见,2可见再次单击,都不可见,如此往复请问这代码怎么写...
先是两个标签都不可见,单击窗体后标签1变为可见,标签2不可见.
再次单击窗体,两个都变成可见,
再次单击窗体,标签1不可见,2可见
再次单击,都不可见,
如此往复
请问这代码怎么写? 展开
再次单击窗体,两个都变成可见,
再次单击窗体,标签1不可见,2可见
再次单击,都不可见,
如此往复
请问这代码怎么写? 展开
1个回答
展开全部
Dim stepNum As Integer
Private Sub Form_Click()
labelVisible
End Sub
Private Sub Form_Load()
stepNum = 0
labelVisible
End Sub
Private Function labelVisible()
Select Case stepNum
Case 0:
Label1.Visible = False
Label2.Visible = False
Case 1:
Label1.Visible = True
Label2.Visible = False
Case 2:
Label1.Visible = True
Label2.Visible = True
Case 3:
Label1.Visible = False
Label2.Visible = True
End Select
stepNum = stepNum + 1
If stepNum > 3 Then stepNum = 0
End Function
Private Sub Form_Click()
labelVisible
End Sub
Private Sub Form_Load()
stepNum = 0
labelVisible
End Sub
Private Function labelVisible()
Select Case stepNum
Case 0:
Label1.Visible = False
Label2.Visible = False
Case 1:
Label1.Visible = True
Label2.Visible = False
Case 2:
Label1.Visible = True
Label2.Visible = True
Case 3:
Label1.Visible = False
Label2.Visible = True
End Select
stepNum = stepNum + 1
If stepNum > 3 Then stepNum = 0
End Function
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询