Visual Basic Questions and Answers – ToolBox Window – Code Editor

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 __________
a) Events
b) Functions
c) Procedures
d) Actions
View Answer

Answer: a
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 __________
a) Operations
b) Event procedures
c) Defining events
d) Defining actions
View Answer

Answer: b
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
View Answer

Answer: c
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.
advertisement
advertisement

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
View Answer

Answer: a
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.
a) Minus
b) Plus
c) Bubble
d) Multiply
View Answer

Answer: a
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.
a) keyword
b) constant
c) variable
d) literal
View Answer

Answer: a
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
View Answer

Answer: c
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.
advertisement

8. The __________ instruction tells the computer to close the current form.
a) Me.Close()
b) Close()
c) This.Close()
d) Close.this()
View Answer

Answer: a
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
View Answer

Answer: a
Explanation: The common tab displays the most commonly used items whereas the all tab displays all the items.
advertisement

10. The rules of a programming language are called its __________
a) Syntax
b) Rules
c) Grammar
d) Order
View Answer

Answer: a
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.

If you find a mistake in question / option / answer, kindly take a screenshot and email to [email protected]

advertisement
advertisement
Subscribe to our Newsletters (Subject-wise). 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!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.