Olete.in
Articles
Mock Tests
🧪 VB.Net MCQ Quiz Hub
VB.Net Mcq Question Set 1
Choose a topic to test your knowledge and improve your VB.Net skills
1. Who developed Visual Basic?
Symantec
Ashton-Tate
Microsoft
Sybase
2. Which of the following statement is used to define a class in visual basic?
Event class statement
Class statement
Form class statement
Event statement
3. Which of the following extension is used to represent the project file in Visual Basic?
.vbp
.vb
.cls
.vvb
4. If you keep a variable undeclared, it is automatically taken as to which of the following data type in Visual Basic?
Char
Int
Object
Strings
5. Which of the following applications can be developed using Visual Basic tool?
Graphical User Interface
Real-time
Character User Interface
All of the mentioned
6. In Visual Basic, which of the following is used for coding single-alternative and dual-alternative selection structures?
Switch-Case block
If…Then…Else statement
function overloading
Recursion
7. What will be the output of the following Visual Basic code, If the intnumber variable is 110? If intnumber<=100 Then Intnumber=intnumber*2; Else Intnumber=intnumber*3; EndIf
180
330
156
270
8. In the Visual Basic application, which of the following are listed in a properties window?
Items
Values
Attributes
Objects
9. What will be the output of the following Visual Basic expression? Financial.Pmt (0.05, 3, 9000)
-3043.88
-3034.88
-3408.48
-3304.88
10. Which of the following is commonly used to perform an immediate action when clicked in Visual Studio?
Button control
Close
End
Exit
11. In the following Visual Basic code, what will be in msg, if str contains “visual basic”? Dim str as String Dim msg as String If str.toUpper=”VISUAL BASIC” msg=”VB.Net” Else msg=”Not Visual Basic” EndIf
Bye
Hi
Logical Error
Compiler Error
12. Which of the following displays the list of projects contained in the Visual Basic current solution?
List Window
Project Window
Catalogue Window
Solution Explorer Window
13. Which of the following method is used to sort an array in visual basic?
Array.Sort()
Array.sortAscending()
Array.arrayArrange()
Array.arrange()
14. Which of the following is the caption part for the following Visual Basic command? MessageBox.Show("Delete Visual Basic?","VB.Net",MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button2).
MessageBoxButtons.YesNo
MessageBoxIcon.Exclamation
“VB.Net”
“Delete Visual Basic?”
15. Which of the following instruction tells the computer to close the current form in Visual Basic?
This.Close()
Me.Close()
Close.this()
Close()
16. Object respond to an event by writing ______
Defining events
Operations
Defining actions
Event procedures
17. What output will be returned if the following Visual Basic code is executed? strVisualBasic = "Sanfoundry, VB.Net" intCharIndex = strVisualBasic.IndexOf("VB")
11
12
False
True
18. What will be the output of the following Visual Basic code? Dim intScores As Integer = {78, 83, 75, 90} Array.Reverse(intScores)
78,75,83,90
90,75,83,78
78, 83, 75,90
75,78, 83,90
19. Which of the following is used to write a stream of characters in Visual Basic?
StreamReader object
StreamReader class
StreamWriter object
StreamWriter class
20. What is the value of len in the following Visual Basic code? Dim strVB() As String = {"Sanfoundry", "Visual Basic", "VB.Net", "Visual Studio"} Dim len As Integer len = strVB.Length()
3
5
4
0
21. Which of the following is the default name assigned to the label control in Visual Basic?
Label1
DefaultLabel
Label0
NewLabel
22. Which of the following toolbox is used to include an image on the Visual Basic form?
Add Image box
Picture Box
Add Picture Box
Image box
23. In visual basic language what are the rules of a programming language called?
Grammar
Order
Syntax
Rules
24. What happens when both the minimize box and maximize box property are set to false in Visual Basic?
Both are removed from the title bar
Both are disabled
This situation shows an exception
This situation shows an error
25. In Visual Basic, which of the following keyword tells the computer to pass the variable’s address rather than its contents?
ByAdd
ByPoint
ByRef
ByVal
26. Which of the following forces a literal constant to assume a data type other than the one its form indicates?
Any literal
Keyword
Literal type constant
Literal type variable
27. Which of the following is used to display a message box in Visual Basic?
MessageBox.Show
MessageBox.show
MessageBox
AlertBox.View
28. In Visual Basic, which of the following method converts a string to a number?
Convert
Tryparse
Extern
Parse
29. Which of the following is used to convert a number from one data type to another in visual studio?
Literal constant
Object
Convert class
Parser
30. Which of the following type of constant is ControlChars.NewLine constant?
Character
Pure
Intrinsic
Invariable
31. The position of an item in a list box depends on which of the following property of the value stored in the list box’s?
Unsorted property
Sorted property
Descending Property
Ascending property
32. Which of the following returns a value after performing its specific task in Visual Basic?
Structure
Sub block
Sub procedure
Function Procedure
33. Which of the following property is used to specify a combo box’s style in Visual Basic?
Style
ComboBoxStyle
DropDownStyle
DropStyle
34. What will be the output of the following Visual Basic code? Dim intScores As Integer = {78, 83, 75, 90} Array.Sort(intScores)
90,83,78,75
78,75,83,90
78, 83, 75,90
75,78, 83,90
35. Which of the following section is used to make text appear around the image?
Wrapping style
Text style
Image properties
Align
36. If the properties of the form are not listed alphabetically, click __________ button to make it alphabetical.
Lexicographical button
Alphabetical button
A-Z button
Arrange button
37. What is a class definition?
It defines object
It defines the appearance and behavior of an object
It defines namespace
It is a prototype
38. What does namespace contain?
Code that defines a group of related classes
Code to define hierarchy
Contains object definition
Contains class definition
39. Form is called as the _____
object
dot member access operator
instance of a class
CLASSPATH
40. Hungarian notations name are entered using ____
camel case
upper case
lower case
both alphabets and numbers
41. Where does the form’s Text Property appear?
Title bar
In Text box in the form
Caption bar
Text bar
42. What does the Start Position Property determine?
initial position on the screen
starting position on the screen
top left corner of the screen
middle of the screen
43. The size property contains the size of ______
form
text on the form
size of any object such as textbox, button, etc on the form
size of the screen
44. The size property contains two numbers separated by comma, and a space. These numbers are ____
width in pixel, height in pixel
height in pixel, width in pixel
height in cm, width in cm
width in cm, height in cm
45. Which is used to restore a property’s value?
Restore button
Reset button
Default button
Back button
46. Who displays the list of projects contained in current solution?
Solution Explorer Window
List Window
Project Window
Catalogue Window
47. Who displays the item contained in each project?
Record Window
List Window
Solution Explorer Window
Index Window
48. By which button you can display the additional items?
Display Button
Show All Files Button
Visible Button
Show Button
49. A ____________ is a file that contains program instructions called code.
Source file
Object file
Executable file
Program file
50. Which box contains the name of the selected object?
Select Box
Object Box
List Box
Display box
Submit