Home

1000+ Visual Basic MCQ for NMAT [Solved]

Thursday 9th of March 2023

Sharing is caring

1. It is possible to insert a picture in a option button control.
A. True.
B. False
C.
D.
Answer : A
2. To get the property window in visual basic you have to press :
A. F3
B. F6
C. F4
D. F6
Answer : C
3. A single function of visual basic takes:
A. Fixed number of parameters
B. Unlimited number of parameters
C. All of the above
D. None of the above
Answer : B
4. Say there is a string "Ramcharan"; when someone using Mid() function like MID("Ramcharan",2) then what will be the output:
A. "Ra"
B. "Ch"
C. "Amcharan"
D. None of the above
Answer : C
5. The full form of IIS is :
A. Indian Institute of Science.
B. Internet Information Service
C. Industrial Information Services.
D.
Answer : B
6. RichTextBox1.BulletIndent=5 ; what will be the effect of this code if used in any program
A. It will set the bulleted indentation by the specified value
B. It will create a list of bullet of 5 items
C. All of the above
D.
Answer : A
7. Flag property is used to adjust the function of each common dialog box
A. True
B. False
C.
D.
Answer : A
8. The project extension name of a VB project is .vbj
A. True
B. False
C.
D.
Answer : B
9. In runtime it is not possible to change the form size.
A. True
B. False
C.
D.
Answer : B
10. It is possible to build an application without using any form:
A. True
B. False
C.
D.
Answer : A
11. Delete method of the recordset of Data Control or Data Access Object is delete the record which is pointed out by the record pointer.
A. True
B. False
C.
D.
Answer : A
12. MDI form1.Arrange vbTileHorizontal; this code in a MDI form will
A. If there are more than one MDI form then arrange them all in horizontal manner
B. Tiles all child form in horizontal manner
C. Tiles the MDI form horizontally
D. None of the above.
Answer : B
13. To run an application you have to press :
A. F3
B. F6
C. F5
D. F7
Answer : C
14. The fundamental property of RichTextBox control is
A. Text property
B. TextRTF property
C. RTFText property
D. All of the above
Answer : C
15. Min and Max property can be used with Font common dialog box to determine
A. To controlling dialog box size
B. The minimum and maximum size displayed in the size list
C. None of the above
D.
Answer : B
16. To draw a form on the screen which event is being called up
A. Draw Event
B. Load Event
C. Paint Event
D. Either i or iii
Answer : C
17. CommonDialogs control is visible at runtime
A. True
B. False
C.
D.
Answer : B
18. Suppose there is a data control named data1. What will be the effect if the following code is inserted
A. Data1.recordset.movefirst
B. The record pointer will move to the first record of the record set
C. The pointer will move to the first record of the original table that contains the data
D. It will refresh the recordset
Answer : B
19. Terminate is a valid event in form operation
A. True
B. False
C.
D.
Answer : A
20. To add the commondialog control to any project one has to include it from
A. File menu->component->Microsoft Common Dialog Control 6.0
B. Project menu->Component-> Microsoft Common Dialog Control 6.0
C. Component menu->project-> Microsoft Common Dialog Control 6.0
D. None of the above
Answer : B
21. The maximum length of a variable is _____________ characters.
A. 255
B. 254
C. 256
D. 257
Answer : A
22. what will be the output of the code below :
private sub command_click()
dim I as integer
I=0
Do
Print I
Loop until I>10
End sub

A. it will generate compile time error
B. it will generate runtime error
C. it is an endless loop
D. 0 1 2 3 4 5 6 7 8 9 10
Answer : C
23. The other Single Document Interface forms are by default child of MDI form when MDI form is inserted.
A. True
B. False
C.
D.
Answer : B
24. Data1.Recordset.FindFirst "State=NY"
The above code will find the record in a given database

A. Find the first record in the given database
B. Find the first record in the given database in which the state is NY.
C. The above command will find a record very fast where the state is NY
D. None of the above
Answer : B
25. Redim statement is used to :
A. Rename a variable.
B. Rename an array.
C. Redimension an array.
D.
Answer : C
26. In visual basic you can draw something in
A. Picture box control.
B. Image control.
C. Shape control.
D.
Answer : A
27. which should be included when an application is used without any forms
A. subroutines
B. function
C. main
D. sub-main
Answer : D
28. Print' statement can be used to print any statement on the screen.
A. True
B. False
C.
D.
Answer : A
29. If the Flag constant for the font common dialog box is cdlCFPrinterFonts then it causes the dialog box to show only the fonts supports by the printer specified by the hdc property
A. True
B. False
C.
D.
Answer : A
30. Now() function will return the current drive and directory you are working on as return value.
A. True
B. False
C.
D.
Answer : B
31. In a programme body :
Private sub form_load()
X=inputbox("First No. :")
Y=inputbox("Second No. :")
Z=val(X) +val(Y)
Print Z
End sub
What will be the output ?

A. The summation of two numbers given in two input box
B. It will show the numbers given in the input box side by side
C. It will show nothing
D. None of the above
Answer : C
32. The title of the dialog box can be changed.
A. True
B. False
C.
D.
Answer : A
33. Instr$(text1.text,"visual") will returns :
A. No. of times the string "visual" is present in the string in text1.text.
B. It puts the control where it finds the text "visual" in the string given in text1.text.
C. First occurrence of the text "visual" within the string given in text1.text
D. None of the above.
Answer : C
34. In form load event, if the following code is written then guess what will be the output :
Dim I as integer, J as integer
I=0
J=5
While I<J
Print I
I=I+1
Wend

A. output will be 0 1 2 3 4
B. No output, blank form will be shown
C. Compiler error
D. None
Answer : B
35. Visual Basic has ____________ number of editions
A. 3
B. 4
C. 5
D. 6
Answer : A
36. When someone uses the code like list1.list(1); then it will return the first item of the list box control.
A. True
B. False
C.
D.
Answer : B
37. To enable apply button in dialog box ; flag value should be set to
A. cdlCFApply
B. cdlcfTTOnly
C. cdcclHelpButton
D. None of the above
Answer : A
38. In visual basic, number of loop control structure is _____________.
A. 4
B. 5
C. 6
D. 7
Answer : C
39. Currency variable stores fixed point numbers with :
A. 2 decimal digits.
B. 3 decimal digits.
C. 4 decimal digits.
D. 6 decimal digits.
Answer : C
40. In timer control _____________ is the most important property.
A. Interval.
B. Front
C. backcolor
D.
Answer : A
41. In a text box control the default caption for text box is text1.
A. True
B. False
C.
D.
Answer : B
42. It is possible to change the shortcut key assigned to any menu for accessing within the menu editor.
A. True
B. False
C.
D.
Answer : B
43. IsDate() function returns true if its argument is a valid date and time
A. True
B. False
C.
D.
Answer : B
44. Sort is a method by which elements can be sorted in flexgrid control
A. True
B. False
C.
D.
Answer : B
45. If the user wants to select the multiple files from file open and filesave dialog boxes then the flag must be set to
A. cdlOFNMultiselsectAllow
B. cdlOFNAllowMultiselect
C. It is not possible to select more than one file at a time
D. None
Answer : B
46. The amount of text any one can place in text box is maximum 64 kb.
A. True
B. False
C.
D.
Answer : A
47. What will be the output when the statements below will execute :
Dim a as integer
a=0
while(a<5)
print a
a=a+1
end

A. It will generate the output like 0 1 2 3 4
B. It will generate a runtime error
C. It will generate a compiler error
D. It will display nothing
Answer : C
48. You can get a dropdown list and as well as can add some text directly to ____________ Control.
A. listbox
B. command
C. Combo Box.
D. none of this
Answer : C
49. Time variable is used to store date and time in visual basic
A. True
B. False
C.
D.
Answer : B
50. Which property of list box control reports the number of selected items.
A. ListIndex
B. Selected
C. Selcount
D. NewIndex
Answer : C

Sharing is caring