根据Shift参数,能够确定使用转换键的情况
根据X、Y参数可以确定触发此事件时鼠标的位置
Button参数的值是在MouseUp事件发生时,系统自动产生的
MouseUp是鼠标向上移动时触发的事件
第1题:
对窗体编写如下事件过程: Private Sub Form_ MouseDown(Button As Integer,Shift As Integer,X As Single,Y As Single) If Button =2 Then Print “AAAAA” End If End Sub Private Sub Form_ MouseUp (Button As Integer,Shift As Integer,X As Single,Y As Single) Print “BBBBB” End Sub 程序运行后,如果单击鼠标右键,则输出结果为______ 。
A.AAAAA BBBBB
B.BBBBB
C.AAAAA
D.BBBBB AAAAA
第2题:
在以下事件过程中,可以在用户按下鼠标右键时,显示一个上边框,以鼠标当前位置为心的弹出式菜单,而且这个弹出式菜单还可以识别右键对菜单命令的选择,相应的选项;
A.Private Sub Form. _ Mouse Up(Button As Integer,Shift AS Integer,_ X As Single,Y As Single) If Button=2 Then PopupMenu mnuEdit,vbPopupMenuCenterAlign Or_ vbPopupMenuRightButton,X,Y,mnuEditOpen End If End Sub
B.Private Sub Form. _ MouseUp(Button AS Integer,Shift AS Integer,_ X As Single,Y As Single) If Button=2 Then PopupMenu mnuEdit, End If End Sub
C.Private Sub Form. _ MouseUp(Button AS Integer,Shift AS Integer,_ X As Single,Y As Single) PopupMenu mnuEdit,vbPopupMenuCenterAlign Or_ vbPopupMenuRightButton End Sub
D.Private SUb Form. _ MouseUp(Button AS Integer,_ Shift As Integer,X As Single,Y As Single) If Button=2 Then PopupMenu mnuEdit,2 End If End Sub
第3题:
设已经在菜单编辑器中设计了窗体的快捷菜单,其顶级菜单为Bt,取消其“可见”属性,运行时,在以下事件过程中,可以使快捷菜单相应鼠标右键菜单的是
A.Private Sub Form_MouseDown(Button As Integer, Shift As Integer,_ X As Single, Y As Single) If Button=2 Then PopupMenu Bt, 2 End Sub
B.Private Sub Form_MouseDown(Button As Integer, Shift As Integer, _ X As Single, Y As Single) PopupMenu Bt End Suh
C.Private Sub Form. MouseDown(Button As Integer, Shift As Integer, _ X As Single, Y As Single) PopupMenu Bt,0 End Sub
D.Private Sub Form_MouseDown(Button As Integer, Shift As Integer, _ X As Single, Y As Single) If (Button=vbLeftButton) Or ( Button=vbRightButton) Then PopupMenu Bt End Sub
第4题:
设窗体上有一个名为Text1的文本框,并编写如下程序: Private Sub Form_Load() Show Text1.Text=" " Text1.SetFocus End Sub Private Sub Form_MouseUp(Button As Integer, Shift As Integer,X As Single,Y As Single) Print“程序设计” End Sub Private Sub Text1_KeyDown(KeyCode As Integer,Shift As Integer) Print "Visual Basic"; End Sub 程序运行后,如果在文本框中输入字母“a”,然后单击窗体,则在窗本上显示的内容是
A.Visual Basic
B.程序设计
C.Visual Basic程序设计
D.a程序设计
第5题:
阅读下列程序: Dim SW As Boolean Function func(X As Integer)As Integer If X<20 Then Y=X Else Y=20+X End If func=Y End Function Private Sub Form_MouseDown(Button As Integer,Shift As Integer,X As Single, Y As Single) SW=False End Sub Private Sub Form_MouseUp(Button As Integer,Shift As Integer,X As Single, Y As Single) SW=True End Sub Private Sub Command1_Click() Dim intNum As Integer intNum=InputBox(" ") If SW Then Print func(intNum) End If End Sub 程序运行后,单击一次窗体,再单击命令按钮,将显示一个输入对话框,如果在对话框中输入20,则程序的输出结果为
A.0
B.20
C.40
D.无任何输出
第6题:
执行下列程序后,鼠标单击窗体,输出结果为
Private Sub Form_Click()
Print "Click";
End Sub
Private Sub Form_MouseDown(Button As Integer,Shift As Integer,X As Single,Y As Single)
Print "Donw"
End Sub
Private Sub Form_MouseUp(ButtonAs Integer,Shift As Integer,X As Single,Y As Single)
Print "Up"
End Sub
A.DownUpClick
B.ClickDownUp
C.DownClickUp
D.UpDownCliek
第7题:
编写如下代码:
Dim Flag As Boolean
Private Sub Form. MouseDown (Button As Integer,
Shift As Integer, X As Single, Y As Single)
Flag = True
End Sub
Private Sub Form. MouseMove (Button As Integer,
Shift As Integer, X As Single, Y As Single)
Flag = False
End Sub
Private Sub Form_ MouseUp (Button As Integer,
Shift As Integer, X As Single, Y As Single)
If Flag = False Then
Print "DDDD"
End If
End Sub
程序运行后,如果想在窗体上输出DDDD,则应执行的操作为______。
第8题:
对窗体编写如下事件过程: Private Sub Form_ Mouse Down(Button As Integer,Shift As Integer,X AS Single,Y As Single) If Button=2 Then Print "AAAAA" End if End Sub Private Sub Form. _ MouseUp(Button As Integer,Shift As Integer,X As Single,Y As Single) Print "BBBBB" End Sub 程序运行后,如果单击鼠标右键,则输出结果为 ______。
A.AAAAA BBBBB
B.BBBBB AAAAA
C.AAAAA
D.BBBBB
第9题:
在窗体上画一个名称为Text1的文本框,并编写如下程序: Private Sub Form_Load() Show Textl.Text="" Textl.Set Focus End Sub Private Sub Form_MouseUp(Button As Inateger,Shift As Integer,X As Single,Y As Single) Frint"程序设计" End Sub Private Sub Textl_KeyDown(KeyCode As InteSer,Shin As Integer) Print"VisualBasic"; End Sub 程序运行后,如果按A键,然后单击窗体,则在窗体上显示的内容是______。
A.Visual Bask
B.程序设计
C.A程序设计
D.ViualBasic程序设计
第10题:
执行下列程序后,鼠标单击窗体,输出结果为
Private Sub Form_Click()
Print "Click";
End Sub
Private Sub Form_mouseDown(Button As Integer,Shift
As Integer, X As Single, Y As Single)
Print "Donw"
End Sub
Private Sub Form_MouseUp(ButtonAsInteger,Shift
As Integer, X As Single, Y As Single)
Print "Up"
End Sub
A.DownUpClick
B.ClickDownUp
C.DownClickUp
D.UpDownClick
第11题:
执行下列程序后,鼠标单击窗体,输出结果为 Private Sub Form_Click() Print"Click": End Sub Private Sub Form_MouseDown(Button As Integer,Shift_As Integer,X As Single,Y As Single) Print"Donw" End Sub Private Sub Form_MouseUp(Button As Integer,Shift_As Integer,X As Single,Y As Single) Print"Up" End Sub
A.DownUpClick
B.CfickDownUp
C.DownClickUp
D.UpDownClick
第12题:
AAAAA
BBBBB
AAAAA CR BBBBB(其中CR表示回车和换行)
BBBBB CR AAAAA
第13题:
设窗体上有一个名为Text1的文本框,并编写如下程序:Private Sub Form_Load() Show Text1.Text="" Text1.SetFocusEnd SubPrivate Sub Form_MouseUp(Button As Integer,_Shift As Integer,X As Single,Y As Single) Print"程序设计"End SubPrinvate Sub Text1_KeyDown(KeyCode As Integer,Shift As Integer) Print "Visual Basic";End Sub 程序运行后,如果在文本框中输入字母“a”,然后单击窗体,则在窗体上显示的内容是。A.Visual BasicB.程序设计C.Visual Basic 程序设计D.a程序设计
第14题:
下面程序是由鼠标事件在窗体上画图,如果按下鼠标可以画图,双击窗体则可以清除所画图形。补充完整下面的程序。首先在窗体层定义如下变量:
Dim PaintStart As Boolean
编写如下事件过程:
Private Sub Form_Load()
DrawWidth=2
ForeColor=vbGreen
End Sub
Private Sub Form_MouseDown(Button As Integer,Shift As Integer,X AS Single,Y AS Single)
PaintStart=True
End Sub
Private Sub Form_MouseMove(Button As Integer,Shift As Integer,X As Single,Y As Single)
If PaintStart Then
PSet(X,Y)
End If
End Sub
Private Sub Form_MouseUp(Button As Integer,Shift As Integer,X As Single,Y As Single)
End Sub
Private Sub Form_DblClick()
Cls
End Sub
第15题:
在窗体上画—个名称为Text1的文本框,并编写如下程序: Private Sub Form_Load() Show Text1.Text==" " Text1.SetFocus End Sub Private Sub Form_MouseUp(Button As Integer,Shift As Integer,X As Single,Y As Single) Print“程序设计” End Sub Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer) Print "VisualBasic"; End Sub 程序运行后,如果按A键,然后单击窗体,则在窗体上显示的内容是 ______。
A.Visual Basic
B.程序设计
C.A程序设计
D.Visual Basic程序设计
第16题:
在窗体上画一个名称为Text1的文本框,并编写如下程序: Private Sub Form Load() Show Text1.Text="" Text1.SetFocus End Sub Private Sub Form_MouseUp(Button As Integer,Shift As Integer,x As Single,Y As Single) Print"程序设计" End Sub Private Sub Text1_KeyDown(KeyCode As Integer,Shift As Integer) Print"Visual Basic"; End Sub 程序运行后,如果按A键,然后单击窗体,则在窗体上显示的内容_________。
A.Visual Basic
B.程序设计
C.A程序设计
D.Visual Basic程序设计
第17题:
设已经在菜单编辑器中设计了窗体的快捷菜单,某顶级菜单为a1,且取消其“可见”属性。运行时,哪个事件过程可以使快捷菜单的菜单项响应鼠标左键单击和右健单击的事件过程是
A.Private Sub Form_MouseDown(Button As Integer,Shift As Integer,X As Single,Y As Single) If Button=2 Then PopupMenu a1,2 End Sub
B.Private Sub Form_MouseDown(ButtonAsInteger,ShiftAsInteger,X As Single,Y As Single) PopupMenu a1,0 End Sub
C.Private Sub Form_Mouse Down(Button As Integer,Shift As Integer,X As Single,Y As Single) PopupMenu a1 End Sub
D.Private Sub Form_MouseDown(Button As Integer,Shift As Integer,X As Single,Y As Single) If(Button=vbLetfButton) Or (Button=vbRightButton) Then PopupMenu a1 End Sub
第18题:
在窗体上画一个名称为Commana1的命令按钮,然后编写如下程序: Dim SW As Boolean Function func(X As Integer)As Integer If X<20 Then Y=X Else Y=20+X End If func = Y End Function Private Sub Form. MouseDown(Button As Integer,_ Shift As Integer,X As Single, Y As Single) SW = False End Sub Private Sub Form_MouseUp( Button As Integer,_ Shift As Integer ,X As Single, Y As Single) SW = True End Sub Private Sub Commandl_Click( ) Dim intNum As Integer intNum = InputBox(" ") If SW Then Print func(intNum) End If End Sub 程序运行后,单击命令按钮,将显示一个输入对话框,如果在对话框中输入25,则程序的执行结果为
A.输出0
B.输出25
C.输出45
D.无任何输出
第19题:
对窗体编写如下事件过程: Private Sub Form_MouseDown(Button As Integer,Shift As Integer,X As Single, Y As Single) If Button=2 Then Print "AAAAA" End If End Sub Private Sub Form_MouseUp(Button As Integer,Shift As Integer,X As Single, Y As Single) Print "BBBBB" End Sub 程序运行后,如果单击鼠标右键,则输出结果为 ______ 。
A.AAAAA BBBBB
B.BBBBB
C.AAAAA
D.BBBBB AAAAA
第20题:
对窗体编写如下事件过程: Private Sub Form. _ MouseDown(BuRon As Integer,Shift As Integer, X As Single, Y As Single) If Button=2 Then Print "AAAAA" End If End Sub Private Sub Form_MouseUp(Button As Integer,Shift As Integer,X As Single, Y As Single) Print "BBBBB" End Sub 程序运行后,如果单击鼠标右键,则输出结果为 ______。
A.AAAAA BBBBB
B.BBBBB
C.AAAAA
D.BBBBB AAAAA
第21题:
在窗体上画一个名称为Text1的文本框,并编写如下程序: Private Sub Form Load( ) Show Text1.Text="" Text1.SetFocus End Sub Pfivate Sub Form_MouseUp(BuHon As Integer,Shift As Integer,X As Single,Y As Single) Print“程序设计” End Sub Private Sub Text1_KeyDown(KeyCode As Integer,shift As Integer) Print"Visua1 Basic"; End Sub 程序运行后,如果按“A”键,然后单击窗体,则在窗体上显示的内容是
A.VisualBasic
B.程序设计
C.A程序设计
D.Visual Basic程序设计
第22题:
设有如下程序; Private Sub Form_ Load() Show Text1.Text = " " Text1.SetFocus End Sub Private Sub Form_ MouseUp (Button As Integer, Shift As Integer, X As Single, Y As SinglE)Print “程序设计” End Sub Private Sub Text1_ KeyDown (KeyCode As Integer, Shift As Integer) Print "Visual Basic" End Sub程序运行后,如果在文本框中输入字母a(即直接按a键),然后单击窗体,则在窗体上显示的内容是______。
A.Visual Basic
B.程序设计
C.Visual Basic程序设计
D.A程序设计
第23题:
AAAAA
BBBBB
AAAAA CR BBBBB(其中CR表示回车和换行)
BBBBB CR AAAAA