首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
下面可以实现此功能的程序是( )。
下面可以实现此功能的程序是( )。
admin
2015-06-30
28
问题
下面可以实现此功能的程序是( )。
选项
A、 Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button=1 Then
Label1="X=" & X & " Y=" & Y
End If
End Sub
B、 Private Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button=1 Then
Label1="X=" & X & " Y=" & Y
End If
End Sub
C、Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button=1 Then
Label1="X=" & X & " Y=" & Y
End If
End Sub
D、 Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Label1="X=" & X & " Y=" & Y
End Sub
答案
C
解析
鼠标移动时产生的事件是MouseMove事件。MouseDown事件过程的参数定义如下:
Sub Form_MouseMove(Button As integer, Shift As Integer, x As Single, y As single)
其中Button表示被按下的鼠标键,按下左键时值为1,按下右键时值为2,按下中间键时值为4。x,y参数表示鼠标光标当前位置的坐标。
题目要求按住左键时移动显示鼠标位置,因此在事件过程要判断是否按下了左键,按下了左键则在标签中显示鼠标位置,否则不显示。因此可用If Button=1来判断是否按下了左键及是否显示鼠标位置。因此应该选择C选项。
转载请注明原文地址:https://jikaoti.com/ti/ot60FFFM
本试题收录于:
二级VB题库NCRE全国计算机二级分类
0
二级VB
NCRE全国计算机二级
相关试题推荐
以下程序段运行的结果是______。Dima(-1To5)AsBooleanDimflagAsBooleanflag=FalseDimiAsIntegerDimjAsInteger
数据库的物理设计是为一个给定的逻辑结构选取一个适合应用环境的______的过程,包括确定数据库在物理设备上的存储结构和存取方法。
下列程序段的功能是输入一元二次方程ax2+bx+c=0(a≠0)的3个系数a、b、c,并判断它根的情况,请将程序补充完整。DimaAsSingle,bAsSingle,cAsSingleDimdeltaAsSin
在窗体中添加一个列表框(ListBox1)和一个命令按钮,并编写如下代码:PrivateSubCommandl_Click()Dima,i,msgmsg="ChooseOKtoadd100itemstoyou
在窗体中添加一命令按钮,并在命令按钮中编写如下代码:PrivateSubCommandl_C1ick()DimaAsSinglea=-1.234567b=Int(A)c=Sgn(A)d=Abs(A)e=Fix(A)
有如下程序:PrivateSubCommandl_Cick()a=10:b=50RemPrinta;bPrintblaPrinta;bEndSub运行后,单击命令按钮后的输出结果是
在窗体(Name属性为Form1)上画两个文本框(其Name属性分别为Text1和Text2)和一个命令按钮(Name属性为Command1),然后编写如下两个事件过程:PrivateSubCommandl_Click()m
下面程序段的输出结果是【】。p=0s=0Dop=p+2s=s+pLoopWhilep<11Print“s=”;s
VB的工程资源管理器可管理多种类型的文件,下面叙述正确的是______。
随机试题
患者,女,72岁。患中风,伴半身不遂、偏身麻木、言语不利,医师根据患者病情开具益气活血、通络止痛的中药汤剂(人参、土鳖虫、水蛭、赤芍、乳香、降香、檀香、全蝎、蜈蚣、冰片、蝉蜕、酸枣仁)。服药10天后患者出现恶心、呕吐、气短、血压下降、溶血性贫血、酱油尿、黑
矿业工程成本管理,不可作为竞争性费用的是()。
受托人委托保管企业年金基金财产的商业银行或专业机构,我们习惯上称之为()。
家庭社会工作的一般性任务是什么?()
矛盾的普遍性与特殊性是矛盾的两种基本属性。()
论述情绪理论中的拉扎勒斯的认知-评价理论。
主张课程设置首先要考虑的是国家和民族的利益的课程流派是()。
全日制普通教育属于()。
有函数模板声明和一些变量定义如下:template<classT1,classT2,classT3>T1sum(T2,T3);doubledl,d2;则下列调用中,错误的是()。
请在“答题”菜单中选择相应的命令,并按照题目要求完成下面的操作。注意:以下的文件必须保存在考生文件夹下。在考生文件夹下打开文档word.docx,按照要求完成下列操作并以该文件名保存文件。按照参考样式“word参考样式.gif”完成设置和制作。设
最新回复
(
0
)