网友您好, 请在下方输入框内输入要搜索的题目:
题目内容
(请给出正确答案)
Private Sub Command1_Click() a=Val(InputBox("请输入a的值=")) b=Val(InputBox("请输入a的值=")) x=a+b Ifa>b Then x=a-b End If Print x End Sub 若运行时从键盘输入a和b分别为3和4,则程序输出的结果为()
- A、1
- B、7
- C、10
- D、11
参考答案
更多 “ Private Sub Command1_Click() a=Val(InputBox("请输入a的值=")) b=Val(InputBox("请输入a的值=")) x=a+b Ifa>b Then x=a-b End If Print x End Sub 若运行时从键盘输入a和b分别为3和4,则程序输出的结果为()A、1B、7C、10D、11” 相关考题
考题
( 26 ) 窗体 中 3 个命令按钮 , 分别命名 为 command1 、 command 2 和 command3, 当单 击 command 1 按钮时 , command 2按钮变为可用, command3 按钮变为不可见,下列 command1 的单击事件过程中,正确的是A ) private sub command1_click()Command2.visible=trueCommand3.visible=falseEnd subB ) private sub command1_click()Command2.enabled=trueCommand3.enabled=falseEnd subC ) private sub command1_click()Command2.enable=trueCommand3.visible=falseEnd subD ) private sub command1_click()Command2.visible=trueCommand3.enable=falseEnd sub
考题
工程中有2个窗体,名称分别为Form1.Form2,Form1为启动窗体,该窗体上有命令按钮Command1,要求程序运行后单击该命令按钮时显示Form2,则按钮的Click事件过程应该是( )。A.Private Sub Command1_Click( )Form2.ShowEnd SubB.Private Sub Command1_Click( )Form2.VisibleEnd SubC.Private Sub Command1_Click( )Load Form2End SubD.Private Sub Command1_Click( )Form2.LoadEnd Sub
考题
在窗体上有一个文件名称为Text1的文本框和1个名称为Command1的命令按钮,要求在程序执行时,每单击命令按钮一次,文本框向右移动一定距离。下面能够正确实现上述功能的程序是( )。A.Private Sub Command1_Click()Text1.Left=100End SubB.Private Sub Command1_Click()Text1.Left= Text1.Left-100End SubC.Private Sub Command1_Click()Text1.Move.Text.Left+100End SubD.Private Sub Command1_Click()Text1.Move.Text.LeftEnd Sub
考题
窗体上有1个名称为Text1的文本框和1个名称为Command1的命令按钮。要求程序运行时,单击命令按钮,就可以把文本框中的内容写到文件out.txt中,每次写入的内容附加到文件原有内容之后。下面能够实现上述功能的程序是( )。A.Private Sub Command1_Click()Open “out.txt” For Inpit As#1Print#1,Text1.TextClose#1End SubB.Private Sub Command1_Click()Open “out.txt” For Outpit As#1Print#1,Text1.TextClose#1End SubC.Private Sub Command1_Click()Open “out.txt” For Append As#1Print#1,Text1.TextClose#1End SubD.Private Sub Command1_Click()Open “out.txt” For Random As#1Print#1,Text1.TextClose#1End Sub
考题
下面程序运行后,窗体中显示【 】。Private Sub Command1_Click) ( )aS ="*" :b$ ="$"For k = 1 To 3x$ =Strings (Len(a$) +k,b$ )Print x $;NextPrintEnd Sub
考题
窗体上添加有3个命令按钮,分别命名为Command1、Command2和Command3。编写 Command1的单击事件过程,完成的功能为:当单击按钮Command1时,按钮Command2 可用,按钮Command3不可见d以下正确的是________。A.Private Sub Command1_Click() Command2.Visible=True Command3.Visible=False End SubB.Private Sub Command1_Click() Command2.Enabled=True Command3.Enabled=False End SubC.Private Sub Command1_Click() Command2.Enabled=True Command3.Visible=False End SubD.Private Sub Command1_Click() Command2.Visible=True Command3.Enabled=False End Sub
考题
工程中有两个窗体,名称分别为Form1、Form2,Fonn1为启动窗体,该窗体上有命令按钮 Command1。要求程序运行后单击该命令按钮时显示Form2,则按钮Click事件过程应该是 ______。A.Private Sub Command1_click() Foma2.Show End SubB.Private Sub Command1_Click() Form2.Visible End SubC.Private Sub Command1_Click() Load Form2 End SubD.Private Sub Command1_click() Form.Load EndSub
考题
以下能够正确计算n!的程序是( )。A.Private Sub Command1_Click()n=5: x=1Dox=x * II=I + 1Loop While I nPrint xEnd SubB.Private Sub Command1_Click()n=5: x=1: I=1Dox=x * II=I + 1Loop While I nPrint xEnd SubC.Private Sub Command1_Click()n=5: x=1: I=1Dox=x * II=I + 1Loop While I =nPrint xEnd SubD.Private Sub Command1_Click()n=5: x=1: I=1Dox=x * II=I + 1Loop While I nPrint xEnd Sub
考题
( 13 )设在窗体上有一个名称为 Command1 的命令按钮和一个名称为 Text1 的文本框。要求单击 Command 1按钮时可把光标移到文本框中。下面正确的事件过程是A ) Private Sub Command1_Click()Text1.GotFocusEnd SubB ) Private SubCommand1.GotFocusEndSubC ) Private Sub Command1_Click()Text1.SetFocusEnd SubD ) Private SubCommand1.SetFocusEnd Sub
考题
有弹出式菜单的结构如下表,程序运行时,单击窗体则弹出如下图所示的菜单。下面的事件过程中能正确实现这一功能的是( )。A.Private Sub Form_Click() PopupMenu cut End SubB.Private Sub Command1_Click() PopupMenu edit End SubC.Private Sub Form_Click() PopupMenu edit End SubD.Private Sub Form_Click() PopupMenu cut End Sub
考题
如下图所示的两个窗体:要使其中第一个窗体中的第一个命令按钮来控制显示第二个窗体,第二个命令按钮用来结束程序的运行(两个按钮名称为Command1和Command2)。则以下选项中,对这两个命令按钮编写的事件过程正确的是A.Private Sub Command1 Click() Form2.Show 1 End Sub Private Sub Command2_Click()End End SubB.Private Sub Command1_Click() Show 1 End Sub Private Sub Conunand2_Click() End End SubC.Private Sub Conmmand1_Click() Show 1 End Sub Private Sub Command2_Click() End End SubD.Private Sub Command1_Click()Show 1, Form2 End SubPrivate Sub Command2_Click() End End Sub
考题
以下能够正确计算n!的程序是A.Private Sub Command1_Chck( ) n=5:x=1 Do x=x*i i=i+1 Loop While i<n Print x End SubB.Private Sub Command1_Click( ) n=5:x=1:i=l Do x=x*i i=i+1 Loop While i<n Print x End SubC.Private Sub Command1_Click( ) n=5:x=1:i=l Do x=x*i i=i+1 Loop While i<=n Print x End SubD.Private Sub Command1_Click( ) n=5:x=1:i=l Dox=x*i i=i+1 Loop While i>n Print x End Sub
考题
Command1_Click()事件代码如下: Private Sub Command1_Click() Dim x As Integer, Y As Integer x = 6 : Y : 8 Call ABC(X, Y) Print X; Y End Sub Private Sub ABC(ByVal X As Integer,Y As Integer) X = X + 4 Y = Y = 2 End Sub 事件发生后,X和Y的值分别为 ______。A.6, 8B.10, 10C.10, 8D.6, 10
考题
以下能够正确计算n!的程序是A.Private Sub Command1 Click() n=5:x=1 Do x=x * I I=I + 1 Loop While I < n Print x End SubB.Private Sub Command1_Click() n=5:X=1:I=1 Do X=X*I I=I + 1 Loop While I <n Print x End SubC.Private Sub Command1_Click() n=5:X=1:I=1 Do X=X * I I=I + 1 Loop While I<=n Print X End SubD.Private Sub Command1_Click() n=5:X=1:I=1 Do x=x * I I=I + 1 Loop While I>n Print X End Sub
考题
下列程序的运行结果是( )。 Private Sub Command1_Click() a=1.5 b=1.5 Call fun(a,b)Print a,b End Sub Private Sub fun(x,y) x=y*y y=y+x End SubA.2.25 3.75B.1.5 2.25C.1.5 0.75D.0.75 1.5
考题
以下事件过程可以将打开的对话框的标题改变为“新标题”的是A.Private Sub Command1_Click() CommonDialog1.DialogTitle=“新标题” CommonDialog1.ShowOpen End SubB.Private Sub Command1_Click() CommonDialog1.DialogTitle=“新标题” CommonDialog1.ShowFont End SubC.Private Sub Command1_Click() CommonDialog1.DialogTitle=“新标题” CommonDialog1.Show End SubD.Private Sub Command1_Click() CommonDialog1.DialogTitle=“新标题” CommonDialog1.ShowColor End Sub
考题
执行下列程序,输入框中显示的默认字符串为【 】。Private Sub Command1_Click( )InputBox "Ok" , "输入参数", Format(" H12" )End Sub
考题
以下能够正确计算n!的程序是A.Privas Sub Command1_Click() n=5:x=1 Do x=x*i i=i+1 Loop While i<n Print x End SubB.Private Sub Command1_Click() n=5:x=1:i=1 Do x=x*i i=i+1 Loop While i<n Print x End SubC.Private Sub Command1_Click() n=5:x=1:i=1 Do x=x*i i=i+1 Loop while i<=n Print x End SubD.Private Sub Command1_Click() n=5:x=1:i=1 Do x=x*i i=i+1 Loop While i>n Print x End Sub
考题
假定通用对话框的名称为CommonDialogl,命令按钮的名称为Command1,则单击命令按钮后,能使打开的对话框的标题为“New File”的事件过程是______。A.Private Sub Command1_Click() CommonDialogl. DialoqTitle="New File" CommonDialogl. ShowPrinter End SubB.Private Sub ComJRandl_Click() CommonDialogl. DialogTitle="New File" CommonDialogl. ShowFont End SubC.Private Sub Command1_Click() CommonDialogl. DialogTitle="New File" CommonDialogl. ShowOpen End SubD.Private Sub Command1_Click() CommonDialogl. DialogTitle="New File" CommonDialogl. ShowColor End Sub
考题
在窗体中添加一个通用对话框Commondialog1和一个命令按钮Command1,当单击按钮时,打开颜色对话框,能实现此功能的程序段是A.Private Sub Command1_Click() Commondialogl.ShowOpen End SubB.Private Sub Command1_Click() Commondialog1.ShowColor End SubC.PrivateSubCommand1_Click() Commondialog1.ShowOpen Commondialog1.ShowFont End SubD.Private Sub Command1_Click() Commondialog1.ShowColor Commondialog1.ShowHelp End Sub
考题
下列程序的输出结果是( )。Private Sub Command1_Click()Dim arr(1 To 10)For i=1 To 10Next iFor Each i In arr()Next iEnd Sub
考题
以下能够正确计算n!的程序是______。A.Private Sub Commeadl_Click() n=5: x=1 Do x=x*i i=i+1 Loop While i<n Print x End SubB.Private Sub Command1_Click() n=5: x=1: i=1 Do x=x*i i=i+1 Loop While i<n Print x End SubC.Private Sub Command1_Click() n=5: x=1: i=1 Do x=x*i i=i+1 Loop Whilei<=n Print x End SubD.Private Sub Commsndl_Click() n=5: x=1: i=1 Do x=x*i i=i+1 Loop While i>n Print x End Sub
考题
在窗体上画了两个按钮控件Command1和Command2,有如下程序: Private Sub Command1_Click() Print "Visual"; End Sub Private Sub Command2_Click() Print "Basic"; End Sub Private Sub Form_Load() CommandCancel=True Command1.Cancel=True End Sub 执行程序后,按键盘Cancel键,在窗体上输出的结果是A.BasicB.VisualC.CancelD.True
考题
有如下VB程序段: Private Sub Command1_Click() Dim a As Long a=Val(Text1.Text) Print a End Sub 其中"Private Sub Command1_Click()"的作用是()。A、定义一个数据处理方法B、定义一个数据输入方法C、定义一个事件过程D、定义一个数据类型
考题
单选题有如下VB程序段: Private Sub Command1_Click() Dim a As Long a=Val(Text1.Text) Print a End Sub 其中"Private Sub Command1_Click()"的作用是()。A
定义一个数据处理方法B
定义一个数据输入方法C
定义一个事件过程D
定义一个数据类型
热门标签
最新试卷