单选题 VB
题号 #2536403

在窗体上画两个标签和一个命令按钮,其名称分别为Label1、Label2和Co mmand1,然后编写下列程序:
Private Sub func(LAs Label)
L .Caption ="1234"
End Sub
Private Sub Form_Load()
Label1.Caption ="ABCDE"
Label2.Caption =10
End Sub
Private Sub Co mmand1_Click()
a=Val(Label2.Caption)
Call func(Label1)
Label2.Caption =a
End Sub
程序运行后,单击命令按钮,则在两个标签中显示的内容分别为( )。

进入在线模考

参考答案

D

答案解析

在Visual Basic 中不仅可以使用变量作为形式参数,还可以使用窗体或控件作为通用过程的参数。本题源程序在命令按钮的单击事件过程中,通过调用过程func 将标签Label1的标题修改为"1234";而标签Label2的标题保持不变,还是10。

你可能感兴趣的试题

找试题 · 找答案 · 找资料 在线模考