MCQs > IT & Programming > Visual Basic MCQs > Basic Visual Basic MCQs

Basic Visual Basic MCQ

1. The default combo box style in visual basic is ____.

Answer

Correct Answer: Dropdown

Note: This Question is unanswered, help us to find answer for this one

2. The ____ operator is evaluated last in the following expression: 9 * 2 - 8>5 + 2 / 2.

Answer

Correct Answer: >

Note: This Question is unanswered, help us to find answer for this one

3. The statement ____ assigns the string madrid to the first element in the strcities array.

Answer

Correct Answer: StrCities(0) =

Note: This Question is unanswered, help us to find answer for this one

4. The code template for an event handler identifies it as a type of __________ procedure.

Answer

Correct Answer: Sub

Note: This Question is unanswered, help us to find answer for this one

5. In recent years, artists have produced ____ sculptures by welding, riveting, and soldering.

Answer

Correct Answer: Direct-metal

Note: This Question is unanswered, help us to find answer for this one

6. The expression isnumeric(13.75) returns the value __________.

Answer

Correct Answer: True

Note: This Question is unanswered, help us to find answer for this one

7. Visual basic provides the ____ method for accessing any number of characters contained in a string.

Answer

Correct Answer: Substring

Note: This Question is unanswered, help us to find answer for this one

8. You can use a(n) ____ to visually separate related controls from other controls on the form.

Answer

Correct Answer: Group box

Note: This Question is unanswered, help us to find answer for this one

9. To execute code in a procedure, a procedure ____ must be made.

Answer

Correct Answer: Call

Note: This Question is unanswered, help us to find answer for this one

10. You use the ____ keyword when you know only one end of a range (either the upper or lower end).

Answer

Correct Answer: Is

Note: This Question is unanswered, help us to find answer for this one

11. A(n) _____ describes information about an object.

Answer

Correct Answer: Attribute

Note: This Question is unanswered, help us to find answer for this one

12. A unique number called a(n) ____ identifies each item in a collection.

Answer

Correct Answer: Index

Note: This Question is unanswered, help us to find answer for this one

13. A ____ provides an area in the form for the user to enter data.

Answer

Correct Answer: TextBox

Note: This Question is unanswered, help us to find answer for this one

14. A ____ procedure completes its task but does not return any data to the calling procedure.

Answer

Correct Answer: Sub

Note: This Question is unanswered, help us to find answer for this one

15. The ____ control element is used to create a custom button.

Answer

Correct Answer: Button

Note: This Question is unanswered, help us to find answer for this one

16. A variable that has block scope can be used ____.

Answer

Correct Answer: Only within the statement block in which it is declared

Note: This Question is unanswered, help us to find answer for this one

17. Traditional database application programs are written in object-oriented languages like ________.

Answer

Correct Answer: Visual Basic

Note: This Question is unanswered, help us to find answer for this one

18. When a project executes, its __________ is automatically displayed.

Answer

Correct Answer: Startup form

Note: This Question is unanswered, help us to find answer for this one

19. The inputbox function always returns a __________ value.

Answer

Correct Answer: String

Note: This Question is unanswered, help us to find answer for this one

20. A ____ exception occurs when code attempts to divide a number by zero.

Answer

Correct Answer: Divide by Zero

Note: This Question is unanswered, help us to find answer for this one

21. The data type string has a named constant, ____, associated with it.

Answer

Correct Answer: String::npos

Note: This Question is unanswered, help us to find answer for this one

22. The character d is the literal-type character for the ____ data type.

Answer

Correct Answer: Decimal

Note: This Question is unanswered, help us to find answer for this one

23. The _____ keyword is required to use relational operators in a case statement.

Answer

Correct Answer: Is

Note: This Question is unanswered, help us to find answer for this one

24. To remove characters from only the beginning of a string, use the ____ method.

Answer

Correct Answer: TrimStart

Note: This Question is unanswered, help us to find answer for this one

25. The windows ____ window allows you to create the graphical user interface for your application.

Answer

Correct Answer: Form Designer

Note: This Question is unanswered, help us to find answer for this one

26. The method that removes characters from only the right end of a string is the ____ method.

Answer

Correct Answer: TrimEnd

Note: This Question is unanswered, help us to find answer for this one

27. All objects in an object-oriented program are instantiated (created) from a ____.

Answer

Correct Answer: Class

Note: This Question is unanswered, help us to find answer for this one

28. A derived class always ____ case or instance of the more general base class.

Answer

Correct Answer: Is a

Note: This Question is unanswered, help us to find answer for this one

29. Programs should use comments (remarks) to ________.

Answer

Correct Answer: Help human readers understand the program

Note: This Question is unanswered, help us to find answer for this one

30. If you want to display multiple lines of information in a message box, use the constant ________.

Answer

Correct Answer: ControlChars.CrLf

Note: This Question is unanswered, help us to find answer for this one

31. By default, parameters are defined as ______________ parameters.

Answer

Correct Answer: Input

Note: This Question is unanswered, help us to find answer for this one

32. The symbol used in code for assignment is the ____ symbol.

Answer

Correct Answer: =

Note: This Question is unanswered, help us to find answer for this one

33. Common ides include visual studio and ____.

Answer

Correct Answer: Eclipse

Note: This Question is unanswered, help us to find answer for this one

34. You use the _________ operator to access members of an object.

Answer

Correct Answer: .

Note: This Question is unanswered, help us to find answer for this one

35. When you use a range check, you compare a variable to the _____ value in the range.

Answer

Correct Answer: Lowest or highest

Note: This Question is unanswered, help us to find answer for this one

36. When defining a variable, the keyword ____ appears at the beginning of the statement.

Answer

Correct Answer: Dim

Note: This Question is unanswered, help us to find answer for this one

37. The syntax ____ assigns a return value to a variable.

Answer

Correct Answer: DblNewPrice = GetNewPrice(dblCurrentPrice)

Note: This Question is unanswered, help us to find answer for this one

38. The loop created by the for...next statement is a ____ loop.

Answer

Correct Answer: Pretest

Note: This Question is unanswered, help us to find answer for this one

39. The following is an example of a module ________.

Answer

Correct Answer: Execution

Note: This Question is unanswered, help us to find answer for this one

40. A(n) ____ is a predefined procedure that performs a specific task and then returns a value.

Answer

Correct Answer: Function.

Note: This Question is unanswered, help us to find answer for this one

41. A variable that has ____ scope can be used anywhere within the procedure.

Answer

Correct Answer: Procedure

Note: This Question is unanswered, help us to find answer for this one

42. A statement that tests a value is called a ____ statement.

Answer

Correct Answer: Conditional.

Note: This Question is unanswered, help us to find answer for this one

43. Each data type is a class from which a variable can be ____.

Answer

Correct Answer: Instantiated

Note: This Question is unanswered, help us to find answer for this one

44. The toolbox window ____.

Answer

Correct Answer: Displays the tools you use when creating your application's interface

Note: This Question is unanswered, help us to find answer for this one

45. The entries in a listbox are stored in the __________ property.

Answer

Correct Answer: Items

Note: This Question is unanswered, help us to find answer for this one

46. The contents of a text box may be cleared in visual basic code by ________.

Answer

Correct Answer: Assigning the predefined constant String.Empty to the text property

Note: This Question is unanswered, help us to find answer for this one

47. The assignment operator in visual basic is the ____ symbol.

Answer

Correct Answer: =

Note: This Question is unanswered, help us to find answer for this one

48. The ________ operator performs string concatenation.

Answer

Correct Answer: Ampersand (&)

Note: This Question is unanswered, help us to find answer for this one

49. The ________ operator performs division and returns the remainder.

Answer

Correct Answer: Modulus %

Note: This Question is unanswered, help us to find answer for this one

50. The ________ control uses a label to display program status information and messages to the user.

Answer

Correct Answer: StatusStrip

Note: This Question is unanswered, help us to find answer for this one

51. The ____ property of a control is used to specify the position of the text within the control.

Answer

Correct Answer: TextAlign

Note: This Question is unanswered, help us to find answer for this one

52. The ____ of a variable specifies where a variable can be referenced within a program.

Answer

Correct Answer: Scope

Note: This Question is unanswered, help us to find answer for this one

53. The ____ of a variable is defined by where it is declared within a program.

Answer

Correct Answer: Scope

Note: This Question is unanswered, help us to find answer for this one

54. The ____ of a programming language is the set of usage rules for that language.

Answer

Correct Answer: Syntax

Note: This Question is unanswered, help us to find answer for this one

55. The ____ method returns an integer that represents the location of the substring within the string.

Answer

Correct Answer: IndexOf

Note: This Question is unanswered, help us to find answer for this one

56. The ____ indicates that a statement is an assignment statement.

Answer

Correct Answer: Equal sign (=)

Note: This Question is unanswered, help us to find answer for this one

57. String variables are automatically initialized using ____.

Answer

Correct Answer: The keyword Nothing (no data at all

Note: This Question is unanswered, help us to find answer for this one

58. You declare a class-level variable using the ____ keyword.

Answer

Correct Answer: Private

Note: This Question is unanswered, help us to find answer for this one

59. You create a named constant using the ____ statement.

Answer

Correct Answer: Const

Note: This Question is unanswered, help us to find answer for this one

60. The select case statement ends with the ____ clause.

Answer

Correct Answer: End Select

Note: This Question is unanswered, help us to find answer for this one

61. The color of the text in a label control is determined by the ________ property.

Answer

Correct Answer: ForeColor

Note: This Question is unanswered, help us to find answer for this one

62. In the code editor, ____ is used to indicate the location of an error.

Answer

Correct Answer: A blue squiggly line

Note: This Question is unanswered, help us to find answer for this one

63. In microsoft visual basic, use the ____ statement to create a string variable.

Answer

Correct Answer: ​Dim

Note: This Question is unanswered, help us to find answer for this one

64. In a case selection structure, you use the ____ keyword when you know only one end of the range.

Answer

Correct Answer: Is

Note: This Question is unanswered, help us to find answer for this one

65. Comparison operators are also referred to as ____ operators.

Answer

Correct Answer: Relational

Note: This Question is unanswered, help us to find answer for this one

66. Arrays that are ____ can be resized at run time.

Answer

Correct Answer: Dynamic

Note: This Question is unanswered, help us to find answer for this one

67. Arguments are contained inside ____ after the name of the procedure to be called.

Answer

Correct Answer: Parentheses

Note: This Question is unanswered, help us to find answer for this one

68. Another term for a selection structure is a ____ structure.

Answer

Correct Answer: Decision

Note: This Question is unanswered, help us to find answer for this one

69. A sub procedure ____ argument(s).

Answer

Correct Answer: Can accept any number

Note: This Question is unanswered, help us to find answer for this one

70. A module-level variable declared public is also known as a __________ variable.

Answer

Correct Answer: Global

Note: This Question is unanswered, help us to find answer for this one

71. A form’s ____ property specifies the text that appears in the form’s title bar.

Answer

Correct Answer: Text

Note: This Question is unanswered, help us to find answer for this one

72. A class-level variable ________.

Answer

Correct Answer: All the three choices here. (is declared inside a class but outside any procedure, is accessible to all procedures in a class, is visible to all statements inside the class)

Note: This Question is unanswered, help us to find answer for this one

73. A class ____ is a collection of classes that can be made available for developers to use.

Answer

Correct Answer: ​library

Note: This Question is unanswered, help us to find answer for this one

74. A ____ is the general shape of the characters in the text.

Answer

Correct Answer: Font

Note: This Question is unanswered, help us to find answer for this one

75. A ____ is an item that is a visible part of a gui.

Answer

Correct Answer: Control

Note: This Question is unanswered, help us to find answer for this one

76. ____ error messages indicate coding errors detected by the compiler.

Answer

Correct Answer: ​Build

Note: This Question is unanswered, help us to find answer for this one

77. From CPU performance point of view, in a loop, is it recommended to use DoEvents?

Answer

Correct Answer: No, but use workarounds such as: GetQueueStatus or GetInputState APIs

Note: This Question is unanswered, help us to find answer for this one

78. You have to parse all the rows in a ListView control. What is the correct statement?

Answer

Correct Answer: for i=1 to ListView1.ListItems.Count

Note: This Question is unanswered, help us to find answer for this one

79. What is the maximum value of the Interval Property for a timer?

Answer

Correct Answer: 65.5 seconds

Note: This Question is unanswered, help us to find answer for this one

80. How do you bold an output text?

Answer

Correct Answer: .SelBold=true

Note: This Question is unanswered, help us to find answer for this one

81. For Excel, what will the following code do? Range("A2").Select: ActiveWindow.FreezePanes = True

Answer

Correct Answer: Freeze Row 1

Note: This Question is unanswered, help us to find answer for this one

82. What command line argument is passed to an out of process COM server to register it

Answer

Correct Answer: regserver

Note: This Question is unanswered, help us to find answer for this one

83. What is the numeric value for the boolean "True"?

Answer

Correct Answer: -1

Note: This Question is unanswered, help us to find answer for this one

84. Which property is required to place a control on Visual Basic 6 MDI Form?

Answer

Correct Answer: Align Property

Note: This Question is unanswered, help us to find answer for this one

85. KeyDown is an example of a:

Answer

Correct Answer: procedure

Note: This Question is unanswered, help us to find answer for this one

86. To make a UserControl transparent

Answer

Correct Answer: Set BackStyle to Transparent

Note: This Question is unanswered, help us to find answer for this one

87. In Visual Basic 6, which one is NOT a parameter of connection objects open method?

Answer

Correct Answer: Source

Note: This Question is unanswered, help us to find answer for this one

88. When an ActiveX project is compiled, its COM interface can be preserved by using Binary Compatibility. Between compilations VB creates different interfaces for modified parts of classes. This is called:

Answer

Correct Answer: Interface Forwarding

Note: This Question is unanswered, help us to find answer for this one

89. Which one of the following cannot be added to a UserControl in VB6

Answer

Correct Answer: OLE Control

Note: This Question is unanswered, help us to find answer for this one

90. For Excel... What is the shortest code that would AutoFit all rows in the active worksheet?

Answer

Correct Answer: Cells.EntireRow.AutoFit

Note: This Question is unanswered, help us to find answer for this one

91. For Excel, what is the shortest code that would change the column width of columns L & X to 30?

Answer

Correct Answer: Range("L:L,X:X").ColumnWidth= 30

Note: This Question is unanswered, help us to find answer for this one

92. What two methods are called from the ObjectContext object to inform MTS that the transaction was successful or unsuccessful?

Answer

Correct Answer: SetComplete and SetAbort.

Note: This Question is unanswered, help us to find answer for this one

93. How do you make a property default in VB 6?

Answer

Correct Answer: Set "Procedure ID" property of property to "(Default)" in "Procedure Attributes" dialog

Note: This Question is unanswered, help us to find answer for this one

94. Which one of the following property pages is not provided by Visual Basic 6

Answer

Correct Answer: StandardLayout

Note: This Question is unanswered, help us to find answer for this one

95. In Visual Basic 6, How will you disable/hide the control box on a form?

Answer

Correct Answer: By Setting ControlBox Property to False or by using Windows API

Note: This Question is unanswered, help us to find answer for this one

96. To debug VB 6 applications with source code using a native debugger like Visual Studio, one must

Answer

Correct Answer: "Compile to Native Code" and enable "Create Symbolic Debug Info"

Note: This Question is unanswered, help us to find answer for this one

97. Which of the following is NOT the value of StartUpPosition property in Visual Basic 6?

Answer

Correct Answer: 4 - Automatic

Note: This Question is unanswered, help us to find answer for this one

98. What does Option Explicit refer to?

Answer

Correct Answer: All variables must be declared before use. Their type is not required.

Note: This Question is unanswered, help us to find answer for this one

99. Which of the following is a correct example of Windows API import declaration in VB6

Answer

Correct Answer: Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (lpvDest As Any, lpvSource As Any, ByVal cbCopy As Long)

Note: This Question is unanswered, help us to find answer for this one

100. What is the difference between LockPessimistic and LockOptimistic ADO locking types.

Answer

Correct Answer: LockPessimistic Locks the row once after any edits occur. LockOptimistic Locks the row only when Update is called.

Note: This Question is unanswered, help us to find answer for this one

101. Lower bound of arrays in VB 6 is

Answer

Correct Answer: Default is 0. Can be set to 1 by "Option Base 1"

Note: This Question is unanswered, help us to find answer for this one

102. What keyword ends a For loop?

Answer

Correct Answer: Next

Note: This Question is unanswered, help us to find answer for this one

103. MDI is an IDE developed by Microsoft and stands for:

Answer

Correct Answer: Multiple Document Interface

Note: This Question is unanswered, help us to find answer for this one

104. What type of executable can VB6 not produce?

Answer

Correct Answer: Native DLL

Note: This Question is unanswered, help us to find answer for this one

105. What code will adjust the Zoom Level on a worksheet in Excel to 80%?

Answer

Correct Answer: ActiveWindow.Zoom = 80

Note: This Question is unanswered, help us to find answer for this one

106. B=2 C=3 What does A=B=C output?

Answer

Correct Answer: False

Note: This Question is unanswered, help us to find answer for this one

107. How do you prevent the screen from flickering while running a macro?

Answer

Correct Answer: Application.ScreenUpdating = False

Note: This Question is unanswered, help us to find answer for this one

108. Can you access and modify the Windows Registry by using VB Scripting?

Answer

Correct Answer: Yes

Note: This Question is unanswered, help us to find answer for this one

109. What is MAPI ?

Answer

Correct Answer: Messaging Application Programming Interface

Note: This Question is unanswered, help us to find answer for this one

110. The '&' symbol is the safest _________ operator to use in Visual Basic.

Answer

Correct Answer: Concatenation

Note: This Question is unanswered, help us to find answer for this one

111. Visual Basic is considered a ___________ programming language.

Answer

Correct Answer: high level

Note: This Question is unanswered, help us to find answer for this one

112. Integer is an example of a:

Answer

Correct Answer: data type

Note: This Question is unanswered, help us to find answer for this one

113. The Enterprise Edition of Visual Basic is aimed at:

Answer

Correct Answer: network oriented clients

Note: This Question is unanswered, help us to find answer for this one

114. The programmer can enter, edit, and view the language of Visual Basic in the:

Answer

Correct Answer: code window

Note: This Question is unanswered, help us to find answer for this one

115. To show a form, use the ____________ command.

Answer

Correct Answer: show

Note: This Question is unanswered, help us to find answer for this one

116. How do you enter in comments without having an output?

Answer

Correct Answer: '

Note: This Question is unanswered, help us to find answer for this one

117. To create a function that returns a value you must use a:

Answer

Correct Answer: function

Note: This Question is unanswered, help us to find answer for this one

118. Once you complete a program, you can compile it into a _________ file.

Answer

Correct Answer: .exe

Note: This Question is unanswered, help us to find answer for this one

119. Visual Basic is derived from:

Answer

Correct Answer: BASIC

Note: This Question is unanswered, help us to find answer for this one

120. What keyword starts every procedure?

Answer

Correct Answer: Sub

Note: This Question is unanswered, help us to find answer for this one

121. Visual Basic is an ____________ driven language.

Answer

Correct Answer: event

Note: This Question is unanswered, help us to find answer for this one

122. Which control can be data bound?

Answer

Correct Answer: All of these

Note: This Question is unanswered, help us to find answer for this one

123. Press _________ to run a program.

Answer

Correct Answer: F5

Note: This Question is unanswered, help us to find answer for this one

124. What keyword(s) end every procedure

Answer

Correct Answer: End Sub

Note: This Question is unanswered, help us to find answer for this one

125. How to declare a variable in VB?

Answer

Correct Answer: Dim (Variable) AS (Datatype)

Note: This Question is unanswered, help us to find answer for this one

126. The default file type for a Visual Basic project is:

Answer

Correct Answer: .vbp

Note: This Question is unanswered, help us to find answer for this one

127. The code to cancel out of a Loop event is:

Answer

Correct Answer: Exit Do

Note: This Question is unanswered, help us to find answer for this one

128. To declare a variable in Visual Basic, you must use the ___________ function:

Answer

Correct Answer: Dim

Note: This Question is unanswered, help us to find answer for this one

129. Which character must be placed at the beginning of a line to indicate that it is a comment (not considered part of the code)?

Answer

Correct Answer: '

Note: This Question is unanswered, help us to find answer for this one

130. A variable can be assigned a value.

Answer

Correct Answer: True

Note: This Question is unanswered, help us to find answer for this one

131. LoadPicture is a function of an Image control that can:

Answer

Correct Answer: populate the picture with an image from a specified directory

Note: This Question is unanswered, help us to find answer for this one

132. When you save a project as an executable file, you are actually:

Answer

Correct Answer: compiling

Note: This Question is unanswered, help us to find answer for this one

133. Visual Basic applications display a Windows style screen called a form.

Answer

Correct Answer: True

Note: This Question is unanswered, help us to find answer for this one

134. Visual Basic can do which of the following?

Answer

Correct Answer: All are correct

Note: This Question is unanswered, help us to find answer for this one

135. The three types of Visual Basic operators are:

Answer

Correct Answer: arithmetic, relational, and logical

Note: This Question is unanswered, help us to find answer for this one

136. Visual Basic 6.0 has been replaced by:

Answer

Correct Answer: VB.NET

Note: This Question is unanswered, help us to find answer for this one

137. Which of the following, when inputted into the command prompt, will successfully launch the Visual Basic script file_name.vbs?

Answer

Correct Answer: All of these are correct

Note: This Question is unanswered, help us to find answer for this one

138. If, Then, Else are examples of:

Answer

Correct Answer: conditionals

Note: This Question is unanswered, help us to find answer for this one