A.Private Sub cmdOK_Click()
If txtUser.Value = "zhangs" Then MsgBox "OK" End if
End Sub
B.) Private Sub cmdOK_Click()
If txtUser.Value = "zhangs" Then
MsgBox "OK"
End Sub
C.Private Sub cmdOK_Click()
If txtUser.Value = "zhangs" Then
MsgBox "OK"
Endif
End Sub
D.Private Sub cmdOK_Click()
If txtUser.Value = "zhangs"
MsgBox "OK"
End If
End Sub
热度🔥426
参考答案:C
解析:
【解析】本题考查是if ...then ... end if语句的语法。A选项中一行写了多条语句,中间需要用“:”隔开,并且当if <条件>then <语句>写在同一行时,可不用end if;B选项缺少“end if”;D选项缺少关键字then。因此,本题应选择C选项。
复制题目向AI提问
按钮cmdOK对应的事件代码是
A.Private Sub cmdOK_Click()
If txtUser.Value = "zhangs" Then MsgBox "OK" End if
End Sub
B.) Private Sub cmdOK_Click()
If txtUser.Value = "zhangs" Then
MsgBox "OK"
End Sub
C.Private Sub cmdOK_Click()
If txtUser.Value = "zhangs" Then
MsgBox "OK"
Endif
End Sub
D.Private Sub cmdOK_Click()
If txtUser.Value = "zhangs"
MsgBox "OK"
End If
End Sub
答案:C。
解析:【解析】本题考查是if ...then ... end if语句的语法。A选项中一行写了多条语句,中间需要用“:”隔开,并且当if <条件>then <语句>写在同一行时,可不用end if;B选项缺少“end if”;D选项缺少关键字then。因此,本题应选择C选项。
">
content_copy