Home

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

Thursday 9th of March 2023

Sharing is caring

1. This view pops up if "Ctrl+F1" is pressed
A. Help
B. Properties Window
C. Dynamic Help
D. Server Explorer
Answer : C
2. If MustOverride is used then ____________ is also a must.
A. Overridable
B. Inherits
C. MustInherit
D. None of the above
Answer : C
3. Only derived class can have shadows keyword
A. True
B. False
C.
D.
Answer : A
4. 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
5. A thread can be started only once
A. True
B. False
C.
D.
Answer : A
6. Using OLEDB you can connect more than one table
A. True
B. False
C.
D.
Answer : A
7. The EventLog's ________ method is used to write an entry to a log file
A. WriteLine
B. WriteEntry
C. Add
D. Append
Answer : B
8. 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
9. VB.NET does not support control arrays
A. True
B. False
C.
D.
Answer : A
10. On error goto lbl is a
A. Structured error
B. Unstructured error
C.
D.
Answer : B
11. To override Finalize function the scope of the function must be
A. Private
B. Public
C. Protected
D. Static
Answer : C
12. A form can not call itself
A. True
B. False
C.
D.
Answer : B
13. To add controls at runtime use
A. Controls.New
B. Controls.AddNew
C. Controls.Add
D. Controls.AddItem
Answer : C
14. The default location of the exe file of your solution is
A. ..../Project folder name
B. .../Project folder name/Bin
C. .../Project folder name/Debug
D. .../Project folder name/Debug/Bin
Answer : B
15. _________ actually updates the values in a DataSet permanently
A. OleDataAdapterq1.update(DataSet1,"emp")
B. DataSet1.Merge(DataSet1)
C. DataSet1.AcceptChanges()
D. DataSet1.Update()
Answer : C
16. 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
17. DataSet can be used to connect to Crystal Report
A. True
B. False
C.
D.
Answer : A
18. If nothing is selected in a combo box, its index value is
A. -1
B. 0
C. 1
D. Null
Answer : A
19. To print use
A. PrintDialog1.Print()
B. PrintDocument1.Print()
C. Printer1.Print()
D. None of the above
Answer : B
20. In ADODB the _____________ property is used to connect to the table
A. RecordSet
B. DataSource
C. RecordSource
D. Connection
Answer : A
21. Application.StartupPath actually points to
A. //ProjectName
B. //ProjectName/Bin
C. //ProjectName/Debug
D. //ProjectName/Bin/ProjectName.exe
Answer : B
22. 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
23. The default event handler of TextBox is
A. KeyPress
B. Changed
C. TextChanged
D. Validating
Answer : C
24. The correct sequence of Form Loading is
A. Load
B. Initialize, Load, Activate
C. Initialize, Activate, Load
D. Activate, Initialize Load
Answer : B
25. A function can have multiple return statements
A. True
B. False
C.
D.
Answer : B
26. 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
27. FolderBrowserDialog displays
A. File
B. Folder
C. Drives
D. b and c
Answer : D
28. 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
29. This property of TrackBar is not present
A. TickStyle.Both
B. TickStyle.None
C. TickStyle.TopLeft
D. TickStyle.BottomLeft
Answer : D
30. Data from DataSet is accessed using34
A. Binding Obejct
B. BindContext Object
C. BindingContext Object
D. EndCurrentEdit Object
Answer : C
31. 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
32. 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
33. 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
34. If Option Explicit is on then Dim i as Integer="10" will produce an error
A. True
B. False
C.
D.
Answer : B
35. 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
36. Structured and Unstructured exceptions can't be mixed
A. True
B. False
C.
D.
Answer : B
37. ________ converts to long datatype
A. Clong
B. CLng
C. Lng
D. None of the above
Answer : B
38. To get details about an error use
A. Err.Message
B. Err.Desc
C. Err.Description
D. Err.Number
Answer : C
39. To display multiple columns in ListView the View property must be set to
A. SmallIcon
B. LargeIcon
C. Details
D. List
Answer : C
40. Images can be loaded from
A. Images.FromFile
B. BitMap.FromFile
C. System.FromFile
D. Both a and b
Answer : D
41. 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
42. In TreeView to get the node the mouse is pointing to, use
A. GetNode
B. Node
C. GetNodeAt
D. SelectNode
Answer : C
43. In Class, Me.Show and MyClass.Show are same (Show is method name)
A. True
B. False
C.
D.
Answer : A
44. ___________ 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
45. A DataSet can hold multiple tables even if there are similar fields
A. True
B. False
C.
D.
Answer : A
46. Finally is fired only when error occurs
A. True
B. False
C.
D.
Answer : B
47. We need multiple ErrorProviders from multiple controls.
A. True
B. False
C.
D.
Answer : B
48. 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
49. Using MyBase you can call base class
A. Constructor
B. Method
C. Variables
D. All of the above
Answer : D
50. 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

Sharing is caring