求人做vb 用if....then.....else结构和select case结构编写程序,要求随
求人做vb用if....then.....else结构和selectcase结构编写程序,要求随着不断单机窗体,窗体的标题依次显示为北京市,上海市,天津市,河北省...
求人做vb
用if....then.....else结构和select case结构编写程序,要求随着不断单机窗体,窗体的标题依次显示为北京市,上海市,天津市,河北省 展开
用if....then.....else结构和select case结构编写程序,要求随着不断单机窗体,窗体的标题依次显示为北京市,上海市,天津市,河北省 展开
2个回答
展开全部
Private Sub Form_Click()
Static n
n = n + 1
If n > 4 Then n = 1
If n = 1 Then
Me.Caption = "北京市"
ElseIf n = 2 Then
Me.Caption = "上海市"
ElseIf n = 3 Then
Me.Caption = "天津市"
ElseIf n = 4 Then
Me.Caption = "河北省"
End If
End Sub
--------------------------------------
Private Sub Form_Click()
Static n
n = n + 1
If n > 4 Then n = 1
Select Case n
Case 1
Me.Caption = "北京市"
Case 2
Me.Caption = "上海市"
Case 3
Me.Caption = "天津市"
Case 4
Me.Caption = "河北省"
End Select
End Sub
Static n
n = n + 1
If n > 4 Then n = 1
If n = 1 Then
Me.Caption = "北京市"
ElseIf n = 2 Then
Me.Caption = "上海市"
ElseIf n = 3 Then
Me.Caption = "天津市"
ElseIf n = 4 Then
Me.Caption = "河北省"
End If
End Sub
--------------------------------------
Private Sub Form_Click()
Static n
n = n + 1
If n > 4 Then n = 1
Select Case n
Case 1
Me.Caption = "北京市"
Case 2
Me.Caption = "上海市"
Case 3
Me.Caption = "天津市"
Case 4
Me.Caption = "河北省"
End Select
End Sub
展开全部
if....then.....else结构:
Private Sub Form_Click()
Static n As Integer
If n = 0 Then
Me.Caption = "北京市"
ElseIf n = 1 Then
Me.Caption = "上海市"
ElseIf n = 2 Then
Me.Caption = "天津市"
ElseIf n = 3 Then
Me.Caption = "河北省"
End If
n = (n + 1) Mod 4
End Sub
select case结构:
Private Sub Form_Click()
Static n As Integer
Select Case n
Case 0
Me.Caption = "北京市"
Case 1
Me.Caption = "上海市"
Case 2
Me.Caption = "天津市"
Case 3
Me.Caption = "河北省"
End Select
n = (n + 1) Mod 4
End Sub
Private Sub Form_Click()
Static n As Integer
If n = 0 Then
Me.Caption = "北京市"
ElseIf n = 1 Then
Me.Caption = "上海市"
ElseIf n = 2 Then
Me.Caption = "天津市"
ElseIf n = 3 Then
Me.Caption = "河北省"
End If
n = (n + 1) Mod 4
End Sub
select case结构:
Private Sub Form_Click()
Static n As Integer
Select Case n
Case 0
Me.Caption = "北京市"
Case 1
Me.Caption = "上海市"
Case 2
Me.Caption = "天津市"
Case 3
Me.Caption = "河北省"
End Select
n = (n + 1) Mod 4
End Sub
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询