Home

1000+ Visual Basic .NET MCQ for GMAT [Solved]

Thursday 9th of March 2023

Sharing is caring

1. Default event handler of Splitter is
A. Splitter.Click
B. Splitter.Clicked
C. Splitter.Drag
D. None of the above
Answer : D
2. Using ADODB multiple tables can be connected at a time
A. True
B. False
C.
D.
Answer : B
3. In TreeView to collapse all the nodes of a selected node ___________ method is used
A. CollapseAll
B. Collapse
C. Any one of the above
D. None of the above
Answer : B
4. You can assign a Main Menu to any control
A. True
B. False
C.
D.
Answer : B
5. 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
6. A TreeView can have multiple root nodes
A. True
B. False
C.
D.
Answer : A
7. If a Form is Inherited from another Form and both Forms have certain codes in their respective Form_Load event, then while running the program
A. Only the first Forms code will be executed
B. Only the second Forms code will be executed
C. Both Forms code will be executed
D. None of the above
Answer : C
8. DomainUpDown control is used only for strings and NumericUpDown for numbers.
A. True
B. False
C.
D.
Answer : B
9. 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
10. Application.StartupPath actually points to
A. //ProjectName
B. //ProjectName/Bin
C. //ProjectName/Debug
D. //ProjectName/Bin/ProjectName.exe
Answer : B
11. A form can not call itself
A. True
B. False
C.
D.
Answer : B
12. 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
13. The EventLog's ________ method is used to write an entry to a log file
A. WriteLine
B. WriteEntry
C. Add
D. Append
Answer : B
14. Set 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.
Answer : B
15. To retrieve the default path of the project use
A. Application.Path
B. Application.DefaultPath
C. Application.StartupPath
D. Application.ProjectPath
Answer : C
16. 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
17. This property of TrackBar is not present
A. TickStyle.Both
B. TickStyle.None
C. TickStyle.TopLeft
D. TickStyle.BottomLeft
Answer : D
18. The name of the IDE window that allows you to see the hierarchical arrangement of the files in your project is
A. Server Explorer
B. Project Explorer
C. Solution Explorer
D. None of the above
Answer : C
19. Using OLEDB you can connect more than one table
A. True
B. False
C.
D.
Answer : A
20. Finally is fired only when error occurs
A. True
B. False
C.
D.
Answer : B
21. _________ and _____________ combines to make a KeyPress event
A. KeyUp, KeyDown
B. KeyEnter, KeyRelease
C. KeyDown, KeyRelease
D. KeyEnter, KeyUp
Answer : A
22. The correct sequence of Form Loading is
A. Load
B. Initialize, Load, Activate
C. Initialize, Activate, Load
D. Activate, Initialize Load
Answer : B
23. If a form call another form and the caller form is closed through code, then both forms are disposed
A. True
B. False
C.
D.
Answer : A
24. ________ converts to long datatype
A. Clong
B. CLng
C. Lng
D. None of the above
Answer : B
25. While handling keystrokes if e.Handled=True is set then Visual Basic
A. Will handle the key
B. Will not handle the key
C. Will send the key to Garbage collector
D. None of the above
Answer : B
26. For the same class "Me" and MyBase" are same
A. True
B. False
C.
D.
Answer : A
27. Data from DataSet is accessed using34
A. Binding Obejct
B. BindContext Object
C. BindingContext Object
D. EndCurrentEdit Object
Answer : C
28. On error goto lbl is a
A. Structured error
B. Unstructured error
C.
D.
Answer : B
29. Only derived class can have shadows keyword
A. True
B. False
C.
D.
Answer : A
30. 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
31. To override Finalize function the scope of the function must be
A. Private
B. Public
C. Protected
D. Static
Answer : C
32. A user wants that custom colors are visible when the Color Dialog Box is first Opened. What should he do?
A. Set AllowFullOpen to True
B. Set AnyColor to True
C. Set Open to True
D. Set FullOpen to True
Answer : D
33. A Class can inherit both Class and Interface at a time
A. True
B. False
C.
D.
Answer : A
34. Using MyBase you can call base class
A. Constructor
B. Method
C. Variables
D. All of the above
Answer : D
35. Dim a() as Integer-{1,2,3,4}is a valid statement
A. True
B. False
C.
D.
Answer : A
36. dim arr(10) as string,
the max index of the array is

A. 9
B. 10
C. Can be >10 also
D. None of the above
Answer : B
37. Two commands can be written in the same line using
A. :
B. ;
C. ,
D. .
Answer : A
38. /*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
39. In ADODB the _____________ property is used to connect to the table
A. RecordSet
B. DataSource
C. RecordSource
D. Connection
Answer : A
40. 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
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. In HelpProvider ___________ property is used to mention the help file name
A. HelpFileName
B. FileName
C. HelpNamespace
D. Name
Answer : C
43. A DataSet can be updated only when the connection is open
A. True
B. False
C.
D.
Answer : B
44. In ListView the item that is currently selected is determined by
A. SelectedItem
B. Item
C. FocussedItem
D. GetSelected
Answer : C
45. To call a buttons click event use
A. Button1.Click
B. Button1.PerformClick
C. Button1.Clicked
D. None of the above
Answer : B
46. Class cc
public _________ I as string
end class
Button1_Click
cc.I=100

A. Share
B. Shared
C. Global
D. Static
Answer : B
47. InputBox by default returns ________ values
A. Integer
B. Byte
C. Double
D. String
Answer : D
48. To view Panels of a StatusBar set _________ to true
A. Panel
B. Panels
C. ShowPanel
D. ShowPanels
Answer : D
49. You create a UserControl having a TextBox and include that in a separate Form. Can you use all the properties of the TextBox in the UserControl from that Form?
A. Yes
B. No
C.
D.
Answer : B
50. Images can be loaded from
A. Images.FromFile
B. BitMap.FromFile
C. System.FromFile
D. Both a and b
Answer : D

Sharing is caring