This set of Visual Basic Multiple Choice Questions & Answers (MCQs) focuses on “ToolBox Window – Code Editor”.
1. The actions such as click, double-click, scrolling etc are __________
Explanation: Click, double-click, scroll, etc are events. It means when you click or double-click a button, some action will take place. These actions are defined in the event procedures that are written.
2. Object respond to an event by writing __________
b) Event procedures
c) Defining events
d) Defining actions
Explanation: You tell an object how to respond to an event, by writing event procedures, which is a set of visual basic instructions that are processed only when the event occurs.
3. Where you enter the event procedure’s code?
a) Event window
b) Properties window
c) Code Editor Window
d) Action Window
Explanation: You enter the event procedure’s code in the code editor window. When you right-click on the form and click View Code on the context menu, the code editor window will open.
4. Which statement is used to define a class in visual basic?
a) Class statement
b) Event statement
c) Event class statement
d) Form class statement
Explanation: The class statement is used to define a class in visual basic. The class statement begins with public class classname clause and ends with End class clause. Within the class statement, you write the code to tell the form and the object how to react to the user’s action.
5. To hide a section of code we click the __________ box next to it.
Explanation: At times we want to hide a section of code, if the code editor contains many lines of code; and we are not presently working on that section of code. To do this, we click the minus box that appears next to the section of the code that we want to hide. To unhide a region of code you click the plus box that appears next to the code. Hiding and unhiding the code is also known as collapsing and expanding the code respectively.
6. A __________ is a word that has special meaning in computer language.
Explanation: A keyword has special meaning in programming language. It appears in different colour from the rest of the code. The Private keyword indicates that the event procedure can be used only within the current Code Editor window.
7. The __________ is an abbreviation of the term sub procedure.
a) Sub function
b) Sub event
c) Sub keyword
d) Sub object
Explanation: The sub keyword is an abbreviation for the term sub procedure, which is a block of code that performs specific task. Following the sub keyword is the name of the object, an underscore, the name of the event, and parenthesis containing some text.
8. The __________ instruction tells the computer to close the current form.
Explanation: The Me.Close() instruction tells the computer to close the current form. If the current form is the only form, then this instruction closes the application. In the instruction Me is a keyword that refers to the current form and Close is one of the methods available in visual basic. A method is a predefined procedure that you can invoke when needed.
9. The __________ displays the most commonly used items.
a) Common tab
b) All tab
c) Most tab
d) Most used tab
Explanation: The common tab displays the most commonly used items whereas the all tab displays all the items.
10. The rules of a programming language are called its __________
Explanation: The Code editor provides the code template to help you follow the rules of the visual basic language. The rules of a programming language are called its syntax. The first line in the code template is called the procedure header and the last line the procedure footer.
Sanfoundry Global Education & Learning Series – Visual Basic.
To practice all areas of Visual Basic, here is complete set of 1000+ Multiple Choice Questions and Answers.
Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!