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分)

解决方案 »

  1.   

    1, B ? 
    2, B
    3, BD ?4,
    Private Sub Form_Resize()
        Label1.Left = Me.Width / 2 - Label1.Width / 2
        Me.Refresh
    End Sub5,
    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 Sub7:
    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
      

  2.   

    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 
      

  3.   

    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
    供参考
      

  4.   

    原来是你的面试题呀,那帮你了,补充一下我上面的答案
    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