更多"一个窗体上有两个文本框,其放置顺序分别是:Text1,Text2,要想"的相关试题:
[单项选择]一个窗体上有两个文本框,其放置顺序分别是:Text1,Text2,要想在Text1中按“回车”键后焦点自动转到Text2上,需编写的事件是()。
A. Private Sub Text1_KeyPress(KeyAscii As Integer)
B. Private Sub Text1_LestFocus()
C. Private Sub Text2_GotFocus()
D. Private Sub Text1_Click()
[单项选择]窗体上有名称分别为Text1、Text2的2个文本框,要求文本框Text1中输入的数据小于
500,文本框Text2中输入的数据小于1000,否则重新输入。为了实现上述功能,在以 下程序中问号(?)处应填入的内容是______。
Private Sub Text1_LostFocus( ) Call CheckInput(Text1,500) End Sub
Private Sub Text2_LostFocus( ) Call CheckInput(Text2,1000) End Sub
Sub CheckInput(t As ,x As Integer) If Val(t.Text)>x Then
MsgBox "请重新输入!"
End If
End Sub
A. Text
B. SelText
C. Control
D. Form
[单项选择]窗体上有名称分别为Text1、Text2的两个文本框,要求文本框Text1中输入的数据小于500,文本框Text2中输入的数据小于1000,否则重新输入。为了实现上述功能,在以下程序中间号( )处应填入的内容是
Private Sub Text1_LostFocus( )
Call CheekInput(Text1,500)
End Sub
Private Sub Text2_LostFocus( )
Call CheekInput(Text2,1000)
End Sub
Sub Cheeklnput(t As , x As Integer)
If Val(t.Text)>x Then
MsgBox "请重新输入!"
End If
End Sub
A. Text
B. SelText
C. Control
D. Form
[单项选择]窗体上有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
[单项选择]在窗体上画一个命令按钮Command1和两个文本框,名称分别为Text 1和 Text 2 Text 2。编写如下两个事件过程:
Dim str As String, strl As String
Private Sub form_load( )
Text1. Text = " "
Text2. Text = " "
Text1. Enabled = False
Text2. Enabled = False
End Sub
Private Sub Form KeyPress(KeyAscii As Integer)
str= str&Chr(KeyAscii)
End Sub
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
str1 = strl&Chr(KeyCode)
End Sub
Private Sub Command1_Click( )
Text1. Text =str
Text2. Text = str1
str= " "
str1= " "
End Sub
当在设计阶段把窗体KeyPreview属性设置为True时,程序运行过程中,在键盘上输入小写字母abc,然后单击命令按钮,则文本框Text1中显示的内容为 ______ 。
A. abc
B. 不显示任何信息
C. ABC
D. 出错
[单项选择]窗体上有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的文本框。Text1的KeyDown事件过程如下:
Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)
Dim s As String
s=Chr(KeyCode+35)
Text2.Text=s
End Sub
当向文本框Text1中输入小写字母a时,文本框Text2中显示的是
A. A
B. a
C. D
D. d
[单项选择]窗体上有两个名称分别为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(Asc(c)+2)
End Sub
当向文本框Text1中输入小写字母a时,文本框Text2中显示的是( )。
A. A
B. a
C. C
D. c
[单项选择]在窗体上画两个名称分别为 Text1、Text2的文本框和一个名称为 Command1的命令按钮,然后编写如下事件过程:
Private Sub Command1_Click( )
Dim x As Integer, n As Integer
x = 1
n = 0
DoW hilex < 20
x = x * 3
n = n + 1
Loop
Text1.Text = Str(x)
Text2.Text = Str(n)
End Sub
程序运行后,单击命令按钮,在两个文本框中显示的值分别是________。
A. 15和 1
B. 27和 3
C. 195和 3
D. 600和 4
[单项选择]在窗体上画两个名称分别为Text1,Text2的文本框和一个名称为Command1命令按钮,然后编写如下事件过程: Private Sub Command1_Click( ) Dim x As Integer,n As Integer x=1 n=0 Do While x<20 x=x*3 n=n+1 Loop Text1.Text=str(x) Text2.Text=Str(n) End Sub 程序运行后,单击命令按钮,在两个文本框中显示的值分别是( )。
A. 15和1
B. 27和3
C. 195和3
D. 600和4