Вы находитесь на странице: 1из 8

Visual Basic : Test 1 (ver 1.3.

00)
Click on the MOST correct answer

Which statement is true about MDI forms? When an MDI child form has a fixed single border (BorderStyle = 1), Microsoft Windows determines its initial height, width, and position when it is loaded When an MDI child form's border is sizable (BorderStyle = 2), it is loaded using its design-time Height and Width properties When an MDI child form has a sizable border (BorderStyle = 2), Microsoft Windows determines its initial height, width, and position when it is loaded When you load the MDI form, its children are automatically loaded What is NOT true about MDI forms? When an MDI form is unloaded, the QueryUnload event is invoked first for the MDI form and then for every child form that is open When a child form is minimized, its icon appears on the taskbar

You cannot show an MDI child form or the MDI form modally (using the Show method with an argument of vbModal) When you load a child form, its parent form (the MDI form) is automatically loaded and displayed

What is not true about MDI Forms? You can't place a control directly on a MDI form unless the control has an Align property or no visible interface When a child form is maximized, its caption is combined with the caption of the MDI form and is displayed in the MDI form's title bar The active child form's menus are displayed on the MDI form's menu bar, not on the child form You can use the AutoLoadChildren property to load MDI child forms and leave them hidden until they're displayed using the Show method What is the correct sequence of form events? Initialize, Load, Paint, Resize, Activate

Initialize, Activate, Resize, Load, Paint Activate, Load, Initialize, Resize, Paint Initialize, Load, Resize, Activate, Paint

You are building an application that incorporates an Excel Spreadsheet. You want to include Excel's menu alongside your form's menu. How would you setup your application to accomplish this? Set the form's NegotiateMenus property to true

Set each menu's NegotiatePosition property to any non-zero number Set the form's NegotiatePosition property to true Set the OLE control's NegotiateMenus property to true

Which database tools are available in all versions of Visual Basic? Remote Data Objects

Data-bound ListBox and ComboBox Data Access Objects Data Control

You have a form with a Data Control. What actions will cause changes to a record to be written to the database? A different record is accessed

The UpdateControls method is used The form is unloaded The UpdateRecord method is used

What is necessary for early binding? ActiveX component supplies type library

ActiveX component implements a DCOM interface Creating an object reference using a variable of a specific class Object instance is created using Set statement using "CreateObject"

What will cause an out-of-process ActiveX Code Component to be registered? The component is run for the first time


yes

Run Regsvr32.exe with the /u option Run the component with the /RegServer command-line argument Use the setup wizard to install the program

10 You are building an application that will use Excel. You need to find information about Excel's events. Where do you look? Event HelpFile

yes

Event Viewer Object Browser Excel Developer Kit

11 You are manually registering components. For which can you use REGSVR32.DLL? yes .OCX
yes

.DLL .EXE .CAB

12 In a project, you have Form1 with PictureBox1 with AutoRedraw = False, Label1, and TextBox1. The following code is executed while the form is minimized. What is displayed when the form is normalized? Text1.text = "ABC Company" Label1.Caption = "Name" Picture1.Print "Invoice #100 $500.00" "ABC Company" "Name" "Invoice #100 $500.00"

yes

"ABC Company" "Name" "Invoice #100 $500.00" "ABC Company" "Name"

13 You are asked to create an application that allows the user to look through several hierarchical layers and displays the individual sets of records for each. What controls would you use? yes TreeView

yes

Outline ListBox ListView

14 An application you are building requires menu selections reflecting

the Most Recently Used files that must change as new documents are used. What will accomplish this? yes At design-time, create a menu item mnuRecentFile with index =0 and visible = False At design-time, enable the MRU property of the mnuRecentFile menu item At run-time, use MenuLoad to add the menu item

At run-time, use MenuAdd to add the menu item

15 What will implement an out-of-process class that can service multiple objects at the same time? yes Set Class1 Instancing property to "SingleUse"

Set Class1 Instancing property to "MultiUse" Set Class1 Instancing property to "Private" Dim oClass1 as New Class1 Dim oClass2 as New Class1

16 For the application you are developing, you expect database activity to result in few conflicts when making changes. What setting would you use? LockEdits = True
yes

LockEdits = False LockOptomistic = False LockOptomistic = True

17 What system object would you use to set the height and width of a form so that it is proportionally the same for all monitor resolutions? App
yes

Screen Desktop Windows

18 What will add an icon to a ListView control? yes Set a ListItem.Icon with a number or key associated with an icon in an ImageList control Set ListView.Icon = LoadPicture("ABC.ico")

Set ListView1.ListItem.SmallIcon = LoadPicture("ABC.ico")

ListView1.IconAdd "ABC.ico"

19 What specifies the bound field to display in a DBList control? yes ListField

BoundText DataField DataSource

20 You have a class with functions that you want to use system wide when developing other applications. What will accomplish this? Add the class module to the other applications
yes

Set the class module's instancing property to GlobalMultiUse Set the class module's instancing property to SystemObject Declare an object as: Dim System oClass1 as Class1

21 What is True when a recordset has no records? BOF = False


yes yes

EOF = True RecordCount = 0 CurrentRecord = 0

22 What is NOT a valid property of a menu control? Disabled

yes

Checked WindowList Invisible

23 What would you use to create a list of open child forms under the Windows menu? WindowList = True
yes

Check the WindowList property in the menu editor for the Windows menu control mnuWindows.AddItem form1.caption Check the ChildWindowList property in the project dialog

24 You are developing an application that requires asynchronous processing between the client and ActiveX server component. What requirements would prompt you to use an Event mechanism in the component for notification? yes The notification can be broadcast anonymously
yes yes

The order in which clients receive the notification is not important The server must get control back after all clients have received the notification Optional arguments are required

25 When you use VBA's built-in procedures to save application settings in Windows 95, where are these written? HKEY_CURRENT_USER\Software\VB and VBA Program Settings Win.ini

As specified in the file parameter HKEY_LOCAL_MACHINE\Software\VB and VBA Program Settings

1. a) The ability to reference objects of the object library 2. a) Better execution speed 3. a) Initialise only 4. a) Cancel = True In QueryUnload 5. c) Dim xlChart as createobject(Excel.Chart) 6. c) to make a procedure in a class available to modules outside that class, but within the same application. 7. a) Watch window 8. b) It runs and completes execution without error 9. c) SaveSetting in the Form_QueryUnload evenTop

of Form

1. What is the main advantage of adding a reference to an object library? a) The ability to reference objects of the object library b) The ability to user the set method. c) The ability to use early binding. d) The ability to use late binding. 2. Which advantage does early binding have over late binding? a) Better execution speed b) Early bound objects can be passed to other objects, late bound objects can not. c) Early bound objects can have events, late bound objects can not.

d) Early binding provides syntax checking before encountering an error at runtime, and late binding does not. 3. Form 1 has variable declared as follows Public ICount as Integer. The application starts with the Sub Main procedure and the first line executed is Form1.iCount = 5 Which Form1 event or events will be triggered by this statement? a) Initialise only b) Load only c) Initialise and load d) Activate and load 4. You are creating an application that has a form with required data fields. You have placed an "Ok" button on the form for the user to click when they have finished entering data on the form. If the user has failed to enter data in a required field, which statement should you use to stop the form from unloading so that you can prompt the user to enter the missing data? a) Cancel = True In QueryUnload b) Cancel = False In QueryUnload c) Cancel = True In Unload d) Cancel = False In Unload 5. Which three steps are required in order to create a reference to an Excel Chart object that is defined in a object library? a) Establish a reference to the type library using a DLL b) Assign an object reference to the variable by using the Implements keyword c) Declare a variable of the objects class like: Dim xlChart as createobject(Excel.Chart) d) Declare a variable of the object's class like: Dim xlChart as createobject("Excel.Chart") 6. What is the purpose of the Friend keyword? a) to make a procedure in a class available only within the class which it is defined. b) to make a procedure in a class available to modules outside that class, including modules in other applications. c) to make a procedure in a class available to modules outside that class, but within the same application. d) to make a procedure in a class available to in-process components.

7. You are monitoring a global variable and want to suspend program execution when its value changes. Which debugging tool should you use? a) Watch window b) Suspend window c) Variables window d) Locals window and e) Immediate window 8. Examine the following code: Sub Test() Static X If X > 3 then Exit Sub Else X = X + 1 Call Test End If End Sub What happens when the Test procedure is called? a) A stack overflow error occurs b) It runs and completes execution without error c) A General Protection fault occurs d) It runs until you forcefully shutdown the application 9. You want to remember a form's state so that when it is opened again, it will appear the same. What function call would you use, and in which event procedure would you place it?

Вам также может понравиться