设已经在菜单编辑器中设计了窗体的快捷菜单,某顶级菜单为al,且取消其"可见"属性。运行时,可以使快捷菜单的菜单项响应鼠标左键单击和右健单击的事件过程是
A. Private Sub Form_Mouse Down(Button As Integer, Shift As Integer,_X As Single,Y As Single If Button=2 Then PopupMenu al,2 End Sub
B. Private Sub Form_Mouse Down(Button As Integer, Shift As Integer,_X As Single, Y As Single PopupMenu al,0 End Sub
C. Private Sub Form_Mouse Down(Button As Integer, Shift As Integer,_X As Single,Y As Single PopupMenu al End Sub
D. Private Sub Form_Mouse Down(Button As Integer, Shift As Integer,_X As Single,Y As Single If(Button=vbLetfButton) Or (Button=vbRightButton) Then PopupMenu al End Sub
查看答案
A.The height of the tree.B.Geography and climate difference.C.Ways of harvesting the b
A. The height of the tree.
B. Geography and climate difference.
C. Ways of harvesting the beans.
D. The temperature of roasting coffee beans.
执行下列程序后,鼠标单击窗体,输出结果为
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
在运行阶段,要在文本框Textl获得焦点时选中文本框中所有内容,对应的事件过程是
A. Private Sub Text1_GotFocus() Text1.SelStart=0 Textl.Se1Length=Len(Text1.Text) End Sub
B. Private Sub Text1_LostFocus() Text1.SelStart=0 Textl.Se1Length=Len(Text1.Text) End Sub
C. Private Sub Text1_Change() Text1.SelStart=0 Textl.Se1Length=Len(Text1.Text) End Sub
D. Private Sub Text1_SetFocus() Text1.SelStart=0 Textl.Se1Length=Len(Text1.Text) End Sub
窗体上有Text1、Text2两个文本框及一个命令按钮Command1,编写下列程序
Dim y As Integer
Private Sub Command1_Click()
Dim x As Integer
x=2
Text1.Text=Fun2(Funl(x),y)
Text2.Text=Funl(x)
End Sub
Private Function Funl(x As Integer) As Integer
x=x+y ∶y=x+y
Funl=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