更多"窗体上有两个文本框Text1、Text2以及一个命令按钮Comanan"的相关试题:
[单项选择]窗体上有两个文本框Text1、Text2以及一个命令按钮Comanand1,编写下列程序:
Dim y As Integer
Private Sub Command1_Click( )
Dim x As Integer
x=2
Text1.Text = p2(p1(x), y)
Text2.Text = p1(x)
End Sub
Private Function p1(x As Integer) As Integer
x=x+y:y=x+y
p1=x+y
End Function
Private Function p2(x As Integer, y As Integer) As Integer
p2=2*x+y
End Function
当单击1次和单击2次命令按钮后,文本框Text1和Text2内的值分别为( )。
A. 2 4
B. 2 4
C. 4 4
D. 10 10
[单项选择]
窗体上有两个名称分别为Text1、Text2的文本框。Text1的KeyUp事件过程如下:
Private Sub Text1_KeyUp(KeyCode As Integer,Shift As Integer)
Dim c As String
c=UCase(Chr(KeyCode))
Text2.Text=Chr(Ase(c)+2)
End Sub
当向文本框Text1中输入小写字母a时,文本框Text2中显示的是()。
A. A
B. a
C. C
D. c
[单项选择]窗体上有两个文本框Text1、Text2以及一个命令按钮Command1,编写下列程序:
DimY As Integer
Private Sub Command1.Click( )
Dim X AS Integer
x=2
Text1. Text=p2(p1(X), Y)
Text2. Text=p1(x)
End Sub
Private Function p1(X As Integer)As Integer
x+x+y:y=x+y
p1=x+y
End Function
Private Function p2(X As Integer, Y As Integer)As Integer
p2=2*x+y
End Function
当单击1次和单击2次命令按钮后,文本框Text1和Text2内的值分别为( )。
A. 2 4
B. 2 4
C. 4 4
D. 10 10
[单项选择]窗体上有两个文本框Text1、Text2以及一个命令按钮Command1,编写下列程序:
Dim y As Integer
Private Sub Command1_Click( )
Dim x As Integer
x=2
Text1.Text=p2(p1(x),y)
Text2.Text=p1(x)
End Sub
Private Function p1(x As Integer)As Integer
x=x+y:y=x+y
p1=x+y
End Function
Private Function p2(x As Integer,y As Integer)As Integer
p2=2*x+y
End Function
当单击1次和单击2次命令按钮后,文本框Text1和Text2内的值分别为( )。
A. 2 4
B. 2 4
C. 4 4
D. 10 10
[单项选择]窗体上有两个名称分别为Text1、Text2的文本框,一个名称为Command1的命令按钮。设有如下的类型声明:
Type Person
name As String *8
major As String*20
End Type
当单击"保存"按钮时,将两个文本框中的内容写入一个随机文件C:///Testl.dat中。设文本框中的数据已正确地赋值给Person类型的变量p。则能够正确地把数据写入文件的程序段是______。
A. Open "c: /Test1.dat" For Random As#1
B. Open "c: /Test1.dat" For Random As#1 Len=
C. Open "c:/Test1.dat" For Random As#1
D. Open "c:/Test1.dat" For Random As#1 Len=
[单项选择]窗体上有两个文本框Text1、Text2以及一个命令按钮Command1,编写下列程序:
Dim y As Integer
Private Sub Command1_Click( )
Dim x As Integer
x=2
Text1.Text=p2(p1(x), y)
Text2.Text=pi(x)
End Sub
Private Function p1(x As Integer) As Integer
x=x+y:y=x+y
p1=x+y
End Function
Private Function p2(x As Integer, y As Integer) As Integer
p2=2*x+y
End Function
当单击1次和单击2次命令按钮后,文本框Text1和Text2内的值分别为( )。
A) 2 4
2 4
B) 2 4
4 8
C) 4 4
8 8
D) 10 10
58 58
[单项选择]在窗体上有两个名称分别为Text1、Text2的文本框,—个名称为Command1的命令按钮。运行后的窗体外观如图所示。 设有如下的类型和变量声明: Private Type Person name As String*8 major As String*20 End Type Dim p As Person 设文本框中的数据已正确地赋值给Person类型的变量p,当单击“保存”按钮时,能够正确地把变量中的数据写入随机文件Test2.dat中的程序段是______。
A. Open "c:/Test2.dat" For Output As #1 Put #1,1,p Close #1
B. Open "c:/Test2.dat" For Random As #1 Get #1, 1, p Close #1
C. Open "c:/Test2.dat" For Random As #1 ten=ten( Put #1,1,p Close #1
D. Open "c:/Test2.dat" For Random As #1 Len=Len( Get #1, 1, p Close #1
[单项选择]在窗体上有两个命令按钮Command1和Commnd2,三个文本框Text1,Text2和Text3,有如下事件过程: Private Sub Comuand1_Click( ) Text3.Text= Text1.Text+Text2.Text End Sub Private Sub Command2_Click( ) Text3.Text= Text3.Text+Str(Val(Text1.Text)+Val (Text2.Text)) End Sub程序运行后,在Text1和Text2中分别输入123、456,然后依次单击Command1和Command2,则在Text3中显示的内容依次是______ 。
A. 123456 579
B. 123456 123456
C. 579 579
D. 579 123456
[单项选择]窗体上有Text1、Text2两个文本框及一个命令按钮Command1,编写下列程序:
Dim y As Integer
Private Sub Command1_Click( )
Dim x As Integer
x=2
Text1.Text=Fun2(Fun1(x),y)
Text2.Text=Fun1(x)
End Sub
Private Function Fun1(x As Integer) As Integer
x=x+y:y=x+y
Fun1=x+y
End Function
Private Function Fun2(x As Integer,y As Integer) As Integer
Fun2=2*x+y
End Function
当单击1次和单击2次命令按钮后,文本框Text1和Text2内的值分别是
A) 2 4
2 4
B) 2 4
4 8
C) 10 10
58 58
D) 4 4
8 8
[单项选择]窗体上有Text1、Text2两个文本框及一个命令按钮Command1,编写下列程序
Dim y As Integer
Private Sub Command1_Click( )
Dim x As Integer
x=2
Text1.Text=Fun2(Fun1(x),y)
Text2.Text=Fun1(x)
End Sub
Private Function Fun1(x As Integer) As Integer
X=x+y:y=x+y
Fun1=X+y
End Function
Private Function Fun2(x As Integer,y As Integer) As Integer
Fun2=2 *x+y
End Function
当单击1次和单击2次命令按钮后,文本框Text1和Text2内的值分别是______。
A. 2 4
B. 2 4
C. 10 10
D. 4 4