Saturday, January 2, 2016

Visual Basic Test Answers 2016.

Find Complete and recently updated Correct Question and answers of Visual Basic Test of Upwork. All Answers updated regularly with new questions. Upwork Visual Basic Test answers of 2016.



Question:* Which of the following is the valid stepping option?

Answer: • Step Behind

Answer: • Step forward

Answer: • Step Into

Question:* Which of the following procedure types will execute when you assign a value to a property of an object?

Answer: • Property Assign

Question:* Which line of code listed here can be used to create a string of fixed length:

Answer: • None of the above

Question:* Which event of an ActiveX control data provider runs every time a bound control extracts data through the provider?

Answer: • RetrieveData

Question:* Which property of the Err object returns the numeric value associated with the most recent runtime error?

Answer: • Number

Question:* Which function or method will you use to get a count of the maximum index limit of an array?

Answer: • UBound function

Question:* Which is the only event of the timer control?

Answer: • Timer

Question:* What you must do before you make calls to an ActiveX DLL project in the same Project Group?

Answer: • Check the DLL off in your project's Reference List

Question:* The _______ property changes the tab order at runtime:

Answer: • Tab index

Question:* Message Boxes can hold a maximum of _______ characters.

Answer: • 1024

Question:* Procedures declared in a _____ are local whereas procedures declared in a ______ are available to the whole application.

Answer: • Form window, standard or code module

Question:* To store pictures in an array, Visual Basic provides the _____ control.

Answer: • ImageList

Question:* Which of the following situations would not cause the Initialize event of an ActiveX control to occur?

Answer: • When a control is placed on a form at design time

Question:* The settings for the Color properties in Visual Basic are indicated by:

Answer: • Hexadecimal Coding

Question:* You want to display the code and the description of an error. What would be the correct syntax?

Answer: • Msgbox err.number & err.description

Question:* The Load & Activate events are associated with:

Answer: • Form

Question:* How do you create a read only property in a form?

Answer: • Create only a Property Get procedure

Question:* In Visual Basic, which method can you use to send key strokes to other Window applications?

Answer: • SendKeys

Question:* Which of the following will provide the best aggregate performance for a query that is not executed repeatedly?

Answer: • Direct execution

Question:* Which of the following is an event of the Shape control?

Answer: • A shape control does not have events

Question:* Labels do not respond to _____ and ______ events.

Answer: • Got_Focus , Lost_Focus

Question:* The ____ function returns the numeric value from a string expression:

Answer: • Val

Question:* Which of the following tools can be used to change the value of a variable or property during break mode of an application?

Answer: • Locals window

Question:* What data type is the HelpContextID?

Answer: • Integer

Question:* The Kill command in Visual Basic is used for:

Answer: • Deleting files

Question:* A prepared statement is:

Answer: • Query text cached on the client

Question:* Which of the following statements should you write to cause the component to fire an event?

Answer: • RaiseEvent

Question:* Which of the following locking types will lock a recordset only during an Update process and not immediately when the data modifications are requested?

Answer: • Batch optimistic

Question:* What is the extension of the Visual Basic project file that stores the design of a user control.

Answer: • .ctl

Question:* You are creating a client application that calls ActiveX DLLs. Which of the following properties of the Err object provides the name of a component that sends an error back to the client application?

Answer: • Source

Question:* Consider the following program code: (i) Dim FileName as String Open FileName For Input As #FreeFile (ii) Dim FileName as String FileNum = FreeFile Open FileName For Input As #FileNum

Answer: • Only (i) is correct

Question:* Variables that allow sharing of values across event procedures are called:

Answer: • Module level variable

Question:* Which property of the form changes the form's title?

Answer: • Caption

Question:* The event Lost_Focus of one object results in _____ of the other object:

Answer: • Mouse_click

Question:* How do you make a control gray and inaccessible in VB?

Answer: • Set enabled to false

Question:* To destroy an object and free the memory space occupied by it, the keyword used is:

Answer: • Nothing

Question:* Which of the following methods is used to inform an ActiveX control's container that one of its properties has been modified?

Answer: • PropertyChanged

Question:* Which of the following is the only valid Resume statement in an error handler?

Answer: • Resume next

Question:* If the CancelError Property of the CommonDialog Box is set to true then which of the following statement is true:

Answer: • None of the above

Question:* In order to enable the DBGridControl or the MSFlexGrid Control to display the contents of a table or query, you need to set only the ______ property:

Answer: • DataSource

Question:* One can convert a Visual Basic Application into ActiveX Document using:

Answer: • ActiveX Document Migration Wizard

Question:* Which event of a text box would you use for validating the data entered by the user?

Answer: • Validate

Question:* Which events enable you to determine which key was pressed by the user?

Answer: • KeyPress, KeyUp and KeyDown

Question:* Which event occurs only once in the entire life cycle of an ActiveX control?

Answer: • Initialize

Question:* Only Controls with a ________ property such as Picturebox, Toolbox, Statusbar etc. can be placed on an MDI form:

Answer: • BorderStyle = 0

Question:* The _______ function enables a VB application to make use of the idle time and to respond periodically to events.

Answer: • DoEvents

Question:* How many root nodes can a TreeView control have?

Answer: • No limit

Question:* In order to overlap the controls (say a command button) during design time, we use the 'Send To Back' or 'Bring To Front' option from the Edit menu. To change it dynamically (i.e. during program execution) we need to change:

Answer: • ZOrder property

Question:* What is the default value for the scalemode property of the form?

Answer: • Twip

Question:* Which of the following ADO recordset types provides the greatest degree of concurrency?

Answer: • Dynamic

Question:* Which collection of an ActiveX control enumerates all of the properties that can be bound to a data source?

Answer: • DataFields

Question:* Which object is used for error handling?

Answer: • Err

Question:* The _______ property enables Visual Basic to draw complete images in memory before displaying them on the Screen.

Answer: • AutoRedraw = True

Question:* Which event should be used to resize an ActiveX control as the user modifies the size of the control implementation on a form?

Answer: • Resize

Question:* Which event is fired when a text box loses focus?

Answer: • LostFocus

Question:* Which of the following approaches to data modifications is the least efficient?

Answer: • An update statement executed directly

Question:* How can you keep the user from exiting a form by clicking the Close button?

Answer: • Place code in the Unload event

Question:* In order to provide a transparent background to the Form, you must change the _________ property to _______.

Answer: • BackStyle, Transparent

Question:* What do CurrentX and CurrentY return?

Answer: • Current X and Y co-ordinates of mousepointer

Question:* Which property of the ProgressBar determines how much of the bar is filled?

Answer: • CurrentVal

Question:* The _______ method loads the form named 'Form1' in to memory and also displays it.

Answer: • Form1.Show

Question:* Which of the following cannot be included in the Open method of the recordset?

Answer: • User Name

Question:* The caption and the name properties of the command button:

Answer: • Can be different at times

Question:* Which of the following statements forces inline error handling?

Answer: • None of the above

Question:* Which of the following debug tools would you use to locate your current position in a series of embedded procedure calls?

Answer: • Callstack

Question:* Which of the following can be shown to the user using the Common Dialog control in VB?

Answer: • Open dialog box

Question:* Consider the following subprogram: Sub ChangeText(ByVal X as String,Y as String) Y = X End Sub If you are calling it using the following code: Call ChangeText(Form1.Caption,Y$)

Answer: • The Caption of Form1 will not change

Question:* Visual Basic fires the _______ event everytime a part of the form is newly exposed.

Answer: • Paint

Question:* What does the forms collection contain?

Answer: • A list of all forms in a project

Question:* You try to initialize a new Object variable with the following line but receive an error. What could be the possible cause? Set MyVar = New Classname

Answer: • You do not have the permission to access the class

Question:* What is the sequence of events when a form is unloaded?

Answer: • Unload only

Question:* In order to change the mouse pointer shape from glass to watch-glass, the property to be used is:

Answer: • MousePointer

Question:* The _______ method resets the contents of bound controls to their original values when the user clicks on the cancel button.

Answer: • UpdateControls

Question:* Which of the following are not properties of Command Button:

Answer: • Multi-Line

Question:* Which form event would you use to activate a pop-up menu when the user clicks the right mouse button?

Answer: • MouseUp

Question:* What does the controls collection contain?

Answer: • A list of all controls on a form

Question:* The interval property of the Timer control specifies the time in:

Answer: • Milliseconds

Question:* Which of the following compiled elements does not run in process?

Answer: • Standard DLL

Question:* Which method will you use to remove a form from the Screen but retain it in memory?

Answer: • Show method

Question:* Global Procedures and Global Variables are declared in:

Answer: • Standard (Code) Modules

Question:* What is the sequence in which the following events are triggered when a form is loaded?

Answer: • Initialize, Load, Resize and Paint

Question:* An ADO dynamic property is:

Answer: • A property that changes value at runtime

Question:* Which event is triggered when the user moves to another open form?

Answer: • Deactivate

Question:* Which event procedure is called only if AutoRedraw property is set to false:

Answer: • Form_Paint

Question:* If one needs to use an ampersand(&) in a Label but does not want it to be an Access Key, the _______ property of the label must be set to False.

Answer: • Locked

Question:* In order to access a file in Non-textual format, you have to open file in:

Answer: • Binary Format

Question:* Which three methods does the collection object support?

Answer: • Add, Remove, Item

Question:* The vbCritical symbol displays:

Answer: • A critical message icon

Question:* To save a file in a RichTextBox Control and a picture in a Picture Box Control, you will use the _________ and __________ statements, respectively:

Answer: • RichText1.SaveFile, Picture1.SavePicture

Question:* The ______ property is used to show Tool Tips or Help Balloons when the mouse rests on the object:

Answer: • ToolTipText

Question:* To deactivate the Form UnLoad event, you make the following change in the function definiton: Private Sub Query_Unload(Cancel as Integer,UnloadMode as Integer) To prevent the Form from closing, you will set the:

Answer: • Cancel parameter to a non-zero value

Question:* Which line of the following code contains an error? 1 public Sub Command1_Click() 2 Dim str As String 2 str = "Hello World" 3 i = val (str) 4 length = strlen(str) 5 Msgbox "No Of Characters in " & str & " = " & CSstr(length) 6 End Sub

Answer: • Error on line 3

Question:* Visual Basic displays information depending upon the current value of two properties of the form, called as:

Answer: • LeftX and LeftY

Question:* After a Dynaset type recordset has been created and opened, further searching is possible using the:

Answer: • FindNext method

Question:* What is the purpose of the Class Builder add-in in Visual Basic:

Answer: • To create new classes and define their properties, methods & events

Question:* Which events allow you to determine if a Control or Shift key was pressed by the user?

Answer: • KeyPress, KeyUp and KeyDown

Question:* You can create menus by the ________ and _________.

Answer: • Menu Editor, Application Wizard

Question:* The ______ function can be used to run any .com, .exe, .bat or .pif file from a Visual Basic program.

Answer: • Shell

Question:* Which of the following is the only drag related event?

Question:* Which of the following statements is capable of abandoning a series of modifications made to a recordset locked with a BatchOptimistic lock?

Question:* Which parameter of the WriteProperty method can be omitted but should be included to increase the efficiency of the control?

Question:* You are creating an ActiveX component that raises user-defined errors. Which of the following statements correctly raises an error to the client with error number 20000?

Question:* You want the code of the close command button to execute upon pressing the ESC key, even though the focus may be on another control in the form. Which property of the command button would you set to true?

Question:* Which method of the Recordset object should you use to navigate multiple recordsets returned by a stored procedure?

Question:* Which of the following will perform a direct execution of a Command object?

Question:* You are creating an ActiveX component that raises user-defined errors. What is the valid range of error numbers that you can use for user-defined errors?

Question:* Which of the following is not an element of the ADO model?

Question:* Which event should you use to store property values into the PropertyBag?

Question:* What is the purpose of the Image List Control?

Question:* Which of the following statements is incorrect regarding toolbars?

Question:* A project group is a Project which:

Question:* Which method would you use to get a free or unused File identifier while opening any file:



No comments:

Post a Comment