vb一些基础问题 兄弟门帮下忙

xiaohen033 2007-05-05 03:36:50
1.How do you display a Pop Up menu mnuPopUp on FormA in an application?
A. Form1.mnuPopUp.Show
B. Form1.PopUpMenu "mnuPopUp"
C. Form1.PopUpMenu mnuPopUp
D. Form1.Menu.Show "mnuPopUp"
2.You want to sort the rsLecturer recordset by the Dept field in ascending order. What is the correct way to do this?
A. rsLecturer.Sort "Dept ASC"
B. rsLecturer.Sort = "Dept ASC"
C. rsLecturer.Sort OrderBy(Dept ASC)
D. rsLecturer.Sort = (Dept ASC)
3.Which of the following options can be used to register an ActiveX DLL? (Choose 2)
A. run the component
B. Use Regsvr32.exe
C. Compile the Component
D. Copy the Component to the Windows System Directory
4.一个窗体上有一个居中的标签,程序在运行过程中,窗体改变大小时,如何使标签自动居中?(4分)
5.请按要求写出VB代码(3分)
要求:假设记录集(RecordSet)已经打开,用ADO,记录集名为RS1,记录集中有两个字段分别为ID,Name,请实现查找ID为“11”,Name为“Jimmy”的记录
答案:
6.如何在状态栏或一个标签上显示鼠标单击位置及移动位置?(4分)
7.请用代码实现在用户关闭窗体(Form1)之前弹出对话框提示用户是否要退出,用户可以选Yes or No(3分)
...全文
331 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
xiaohen033 2007-05-09
  • 打赏
  • 举报
回复
谢谢上面的几位兄弟了 ~~~~
hanxiao6904 2007-05-08
  • 打赏
  • 举报
回复
1,C
2,不敢确定
3,B
4,在form_resize()事件中
label.move from1.scalewidth/2,form1.scaleheight/2,width,height
5,select * from rs1 where [ID]="11" and [name]="jimmy"
6,有一个鼠标跟踪的API函数,我忘了,你自己查一下吧
7,private sub FORM_queryunload()
msgbox "要关闭吗",vbyesno+vbquestion
end sub
hanxiao6904 2007-05-08
  • 打赏
  • 举报
回复
原来是你的面试题呀,那帮你了,补充一下我上面的答案
1,C 肯定没错,我现在的程序中就这样用的
3,原来是选两个呀,刚才没看清BD
6,用GetcursorPos函数
private type pointAPI
x as long
y as long
end type
dim p as pointAPI
call GetcursorPos(p)
print p.x p.y
xingmaohai 2007-05-08
  • 打赏
  • 举报
回复
1:C
2:B
3:B C
4:sub form_resize()
label1.left=(me.width-label1.width)/2
label1.top=(me.height-label1.height)/2
end sub
5:rs1.find "id='11' and name='Jimmy'"
6:用API
7:sub form_unload(cancel as integer)
If MsgBox("确认退出吗?", vbYesNo + vbQuestion, "询问") = vbYes Then
Cancel = False
Else
Cancel = True
End if
end sub
供参考
xiaohen033 2007-05-08
  • 打赏
  • 举报
回复
呵呵 前面的3个选择题 你们出现2种答案 麻烦了 谁对呢 谁错呢 ??????
清晨曦月 2007-05-07
  • 打赏
  • 举报
回复
呵呵........一个也不会.
beal_p 2007-05-07
  • 打赏
  • 举报
回复
1, B ?
2, B
3, BD ?

4,
Private Sub Form_Resize()
Label1.Left = Me.Width / 2 - Label1.Width / 2
Me.Refresh
End Sub

5,
rs1.find "[ID]='11' and [name] = 'Jimmy'"

6
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Me.Label1.Caption = "Now Mouse is " & X & ":" & Y
End Sub

7:
Private Sub Form_Unload(Cancel As Integer)
If MsgBox("Are you sure to close?", vbQuestion + vbYesNo, "Close") = vbNo Then
Cancel = True
End If
End Sub
CathySun118 2007-05-06
  • 打赏
  • 举报
回复
帮顶
xiaohen033 2007-05-05
  • 打赏
  • 举报
回复
多很简单的 就是我没接触过 现在没时间去学了 所以那位知道的话 抽点时间帮小弟做下 是面试题目,谢谢了

7,763

社区成员

发帖
与我相关
我的任务
社区描述
VB 基础类
社区管理员
  • VB基础类社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧