0% found this document useful (0 votes)
74 views1 page

Visual Basic MCQs and Answers

The document contains 10 multiple choice questions about Visual Basic programming concepts. The questions cover topics like what Visual Basic allows you to develop, events like Form_MouseDown, methods like Hide and SetFocus, tools for finding object properties, where constants can be declared, string functions like LTrim, default properties of controls, and variable declaration keywords.

Uploaded by

Panjatcharam Vg
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
74 views1 page

Visual Basic MCQs and Answers

The document contains 10 multiple choice questions about Visual Basic programming concepts. The questions cover topics like what Visual Basic allows you to develop, events like Form_MouseDown, methods like Hide and SetFocus, tools for finding object properties, where constants can be declared, string functions like LTrim, default properties of controls, and variable declaration keywords.

Uploaded by

Panjatcharam Vg
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Visual Basic Programming MCQs

1. Visual Basic is a tool that allows you to develop application in…………


a. Real time
b. Graphical User Interface
c. Character User Interface
d. None of These
2. Form_Mouse Down ( ) procedure is executed when any mouse button is clicked in a free area of
the .
a. window
b. form
c. screen
d. None of the above.
3. method removes a dialog box from view.
a. Display
b. Disable
c. Hide
d. Enabled
4. is used for finding out about objects, properties and methods.
a. Object browser
b. Form layout window
c. Code editor window
d. None of the above
5. cannot be declared in a form or class module
a. Public constants
b. Private constants
c. Static constants
d. None of these
6. function is used to return a copy of a string without leading spaces.
a. Ltrim
b. Rtrim
c. Trim
d. All of the above
7. is a method which moves the focus to the specified control or form
a. Setfocus
b. Gotfocus
c. Lostfocus
d. None of these
8. The default property for a text box control is
a. Text
b. Password char
c. Multiline
d. Enable
9. The is a tool used for both the Input and output purpose.
a. command button
b. text box
c. label
d. combo box
10. In visual basic the declaration of variables is done by key word.
a. int
b. dim
c. static
d. declare

Common questions

Powered by AI

The Setfocus method facilitates user interaction by programmatically moving the cursor focus to a specified control or form, enabling immediate user input and ensuring workflow continuity . This is particularly beneficial in form navigation, where specific inputs are required systematically, or in error handling, where the user is guided back to missed or incorrect fields.

Visual Basic is distinguished by its use of a Graphical User Interface (GUI) for application development, which contrasts with other programming environments that may rely on command-line or character-based interfaces . This GUI focus allows developers to create applications more intuitively and can enable rapid development by visually connecting components like buttons and text boxes.

The text box serves as a dual-purpose tool by allowing users to input data directly while also displaying output data, such as calculations or status messages . This versatility makes it an essential component for interactive applications, providing a straightforward way to engage with users through a single interface element in both data input and presentation roles.

Having the Text property as the default for a text box control underscores its primary function as a data entry component . This default setting simplifies development by ensuring that the text box's main purpose is emphasized, reducing the need for additional configuration and streamlining data retrieval within forms, thereby enhancing usability and coding efficiency.

The Form_Mouse Down event allows developers to execute specific code when the mouse button is clicked within a free area of the form . This capability is crucial for building interactive applications, as it enables developers to respond to user actions directly through mouse interactions, enhancing user experience and control over the application.

The Object Browser is a tool that provides an easy way to explore the objects, their properties, and methods used within Visual Basic . It plays a crucial role by offering a centralized database for all components, enabling developers to efficiently locate necessary resources, understand dependencies, and reduce errors by providing context-specific information, thus streamlining the development process.

The 'dim' keyword in Visual Basic plays a critical role in variable declaration, allowing the definition of variables' type and scope, which influences both memory allocation and accessibility . Proper use of 'dim' promotes structured code by clearly delineating variable lifecycles and minimizing conflicts, thus enhancing readability and maintainability by fostering a clear organization of code components.

The Ltrim function improves data handling by removing leading spaces from strings, thus ensuring uniformity and cleanliness of data presentation . This can streamline data processing and reduce storage redundancy. It is particularly beneficial in input validation and formatting when handling user inputs or file-based data import, leading to enhanced data integrity and visual uniformity.

Declaring public, private, or static constants within a form or class module may be inappropriate when constants are intended for global application use but are declared privately, limiting accessibility . Conversely, public constants can lead to unintended modifications across different modules when unchecked. Static constants lose relevancy if persistence is not required through multiple instances, advocating for careful consideration of scope and context.

The Hide method is effective for managing dialog box visibility as it removes the box from view without closing it, allowing the dialog's state to be preserved and restored easily when needed . This method is particularly useful for applications requiring temporary multiple screen overlays or maintaining state without reinitializing controls, ensuring a seamless user experience.

You might also like