Home

Visual Basic .NET 1000+ MCQ with answer for GRE

Thursday 9th of March 2023

Sharing is caring

1. Use a _________ statement to make Visual Basic object the default object for a set of enclosed Visual Basic statements.
A. With
B. Using
C. Import
D. Inherit
Answer : A
2. In Class, Me.Show and MyClass.Show are same (Show is method name)
A. True
B. False
C.
D.
Answer : A
3. A thread can be started only once
A. True
B. False
C.
D.
Answer : A
4. Data from DataSet is accessed using34
A. Binding Obejct
B. BindContext Object
C. BindingContext Object
D. EndCurrentEdit Object
Answer : C
5. Get method is used to
A. Assign a value to an user control
B. Read value from an user control
C. Both of the above
D. None of the above
Answer : A
6. To print use
A. PrintDialog1.Print()
B. PrintDocument1.Print()
C. Printer1.Print()
D. None of the above
Answer : B
7. We need multiple ErrorProviders from multiple controls.
A. True
B. False
C.
D.
Answer : B
8. If Option Explicit is on then Dim i as Integer="10" will produce an error
A. True
B. False
C.
D.
Answer : B
9. A single OLEDBAdapter can have many DataSets
A. True
B. False
C.
D.
Answer : A
10. To vertically arrange all forms in an MDI form use
A. Me.Layout(MdiLayout.TileVertical)
B. Me.MdiLayout(MdiLayout.TileVertical)
C. Me.LayoutMdi(MdiLayout.TileVertical)
D. Nothing is required because default is Vertical
Answer : C
11. To use HelpProvider, the following properties of the form needs to be set
A. HelpButton
B. MaximizeBox
C. MinimizeBox
D. All of the above
Answer : D
12. If a button click event is to be fired when the user press the 'Esc' key, set the buttons name against forms _________ property
A. DefaultButton
B. AcceptButton
C. DialogResult
D. CancelButton
Answer : D
13. If you want to open a file named "a.txt" use
A. System.diagnostics.Start("a.txt")
B. System.Start("a.txt")
C. System.diagnostics.Process.Start("a.txt")
D. System.Process.Start("a.txt")
Answer : C
14. Default event handler of Splitter is
A. Splitter.Click
B. Splitter.Clicked
C. Splitter.Drag
D. None of the above
Answer : D
15. PasswordChar property of a TextBox can accept " " (space) as the password char
A. True
B. False
C.
D.
Answer : B
16. If nothing is selected in a combo box, its index value is
A. -1
B. 0
C. 1
D. Null
Answer : A
17. If an user-defined class have a user-defined event then, the class object is declared as
A. Dim c as new ClassName
B. Dim withEvents c as new ClassName
C. Dim c as ClassName
D. Dim withEvents c as ClassName
Answer : B
18. A DataSet can hold multiple tables even if there are similar fields
A. True
B. False
C.
D.
Answer : A
19. Only derived class can have shadows keyword
A. True
B. False
C.
D.
Answer : A
20. To retrieve the default path of the project use
A. Application.Path
B. Application.DefaultPath
C. Application.StartupPath
D. Application.ProjectPath
Answer : C
21. Function abc() As String
Return 10
End Function

A. Will produce compilation error
B. Will produce runtime error
C. The function will execute normally
D. None of the above
Answer : A
22. ___________ is used to pass copies of a variable while __________ is used to pass address of a variable.
A. Byval, Byref
B. Byref, Byval
C. Any one of the above
D. None of the above
Answer : A
23. ________ converts to long datatype
A. Clong
B. CLng
C. Lng
D. None of the above
Answer : B
24. Class cc
public _________ I as string
end class
Button1_Click
cc.I=100

A. Share
B. Shared
C. Global
D. Static
Answer : B
25. A single LinkLabel can support multiple links
A. True
B. False
C.
D.
Answer : A
26. ScrollBars can be added to
A. Panel
B. GroupBox
C. Both a and b
D. None of the above
Answer : A
27. /*1. Class C
2. public notoverridable sub abc()
3. msgbox("Base Class")
4. end sub
5. end Class /* The Error in Line No.

A. 2
B. 3
C. 4
D. No Error
Answer : A
28. To display multiple columns in ListView the View property must be set to
A. SmallIcon
B. LargeIcon
C. Details
D. List
Answer : C
29. In TreeView to get the node the mouse is pointing to, use
A. GetNode
B. Node
C. GetNodeAt
D. SelectNode
Answer : C
30. In ListView the item that is currently selected is determined by
A. SelectedItem
B. Item
C. FocussedItem
D. GetSelected
Answer : C
31. If MustOverride is used then ____________ is also a must.
A. Overridable
B. Inherits
C. MustInherit
D. None of the above
Answer : C
32. Dim S as Integer=10
Text1=S
Msgbox(Text1.Text)

A. Will return error
B. Will return 10
C. Will return 0
D. Will return Null
Answer : A
33. To call a buttons click event use
A. Button1.Click
B. Button1.PerformClick
C. Button1.Clicked
D. None of the above
Answer : B
34. This view is not present in VB.NET
A. Project Explorer
B. Class View
C. Resource View
D. Server Explorer
Answer : A
35. A TreeView can have multiple root nodes
A. True
B. False
C.
D.
Answer : A
36. To override Finalize function the scope of the function must be
A. Private
B. Public
C. Protected
D. Static
Answer : C
37. For the same class "Me" and MyBase" are same
A. True
B. False
C.
D.
Answer : A
38. In reports ___________ property help to assign user-defined criteria
A. ReportSource
B. SectionFormula
C. Query
D. SelectionFormula
Answer : D
39. DataSet can be used to connect to Crystal Report
A. True
B. False
C.
D.
Answer : A
40. What cannot be done if the table has no primary key
A. Insert and Update
B. Update and Delete
C. Select and Delete
D. Insert and Select
Answer : B
41. /*1. Class C
2. public mustinherit sub abc()
3. msgbox("Base Class")
4. end sub
5. end Class /* The error is in line no.

A. 1
B. 2
C. 3
D. 4
Answer : A
42. To make a button the default button, this property of the form must be set
A. DefaultButton
B. AcceptButton
C. DialogResult
D. None of the above
Answer : B
43. The default event handler of TextBox is
A. KeyPress
B. Changed
C. TextChanged
D. Validating
Answer : C
44. The default Tab of a Tab Control is
A. The first tab
B. The last tab added
C. The last tab modified
D. There is no default tab.
Answer : A
45. Application.StartupPath actually points to
A. //ProjectName
B. //ProjectName/Bin
C. //ProjectName/Debug
D. //ProjectName/Bin/ProjectName.exe
Answer : B
46. To add items stored in an array to a ListView use
A. List1.Add(name of the array)
B. List1.AddItem(name of the array)
C. List1.Items.Add(name of the array)
D. List1.Items.Addrange(name of the array)
Answer : D
47. To redimension an array with its previous values intact use ___________ keyword
A. RedimPreserve
B. Preserve
C. Redim
D. Redim Preserve
Answer : D
48. /*1. OleDataAdapterq1.update(DataSet1,"emp")
2. OleDataAdapterq1.update(DataSet1,"std")
3. DataSet1.Merge(DataSet1)
4. DataSet1.AcceptChanges()
/* The error is in line

A. 2
B. 4
C. 3
D. No Error
Answer : D
49. A DataSet can be updated only when the connection is open
A. True
B. False
C.
D.
Answer : B
50. A form can have only ______ Main Menu and _________ Context Menu
A. 1,1
B. 1,Multiple
C. Multiple,1
D. 1,2
Answer : B

Sharing is caring