T.Y.I.

T
VISUAL BASIC - THEORY QUESTIONS
1.
2.
3.
4.
5.

What is the difference between a property, a method and an event in VB?
What’s the difference between a combo box and a list box control?
Write a short note on any 5 controls from toolbox.
Write short note on logical and relational operators.
What are the key features of object oriented programming language and how are
they achieved in VB.
6. Explain the use of Printer. Print with various examples.
7. List and explain different file modes of data files.
8. What is the difference between random and sequential files?
9. What triggers the initialize event and terminate event of an object.
10. What is the format for the statements to read and write sequential files? Give
example.
11. What is a variant data type? State its advantages and disadvantages.
12. Explain any 5 string related functions.
13. Write a short note on dialog box control and its uses.
14. Explain how data is passed by reference and by value in procedures.
15. Explain the use of Msgbox () function with suitable example.
16. Discuss the scope of a variable.
17. Which are the different data types available in VB.
18. What do u mean by Visual Basic Environment.
19. What are various windows in VB environment? Explain each one in detail.
20. What are the different modes in VB.(run mode, design mode, break mode)
21. What is a twip? Express one twip in terms of inches.(1 twip=1/1499 inches)
22. Write a short note on VB Event procedures. (Syntax and e.g.)
23. What are the fundamental VB code statements? (remark, assignment, end)
24. What are assignment statements? Explain by giving in general syntax and an
example.
25. Explain the difference between “End” statement and “Unload” statement.
26. What are the types of programming errors? (Logical errors, runtime errors,
compile errors)
27. What is debugging?
28. What property should be set to center text in a label? What should be the value of
that property?
29. What is the General Declarations section of form module?
30. Explain the use of Frame control in design of a form.
31. What are the various options for a shape property of a Shape control?
32. What are Access keys?
33. What are the Default and Cancel properties for a command button?
34. Explain the use of ToolTipText property.
35. What’s the use of Setfocus methods
36. What are the various properties for the font object?
37. Name the color constants used in VB.
38. Explain along with syntax and example the “With” and “End With” statement.
39. How does the behavior of option buttons differ from that of check boxes?
40. If you want a group of option buttons on a form, how can u make the groups work
independently?
41. What is the focus? How can u controls, which object, has the focus?
42. What is the default data type of any variable? Explain it in detail. (Variant)
1

T.Y.I.T
43. What are named constants and how are they different from intrinsic constants?
44. What is the lifetime of a variable? How does it change according to the scope of
the variable?
45. Explain the use of Val () function.
46. Explain the need of Option Explicit statement. How the settings for this statement
are done?
47. Explain how to make interest rate stored in srate display as a percentage with 3
decimal digits.
48. Explain UCASE and LCASE functions in detail.
49. Explain the general form of Msgbox () function.
50. How to create multiple lines output in a message box.(vbCRLF)
51. Explain IsNumeric and IsDate functions.
52. What is the use of Immediate window?
53. Explain the difference between Step Into and Step Over commands in debug
menu.
54. Why would it be useful to include the UCase function in a comparison?
55. What steps are necessary to view the current contents of a variable during
program execution?
56. What is a separator bar and how it is created?
57. What is the purpose of Name and Caption properties of the menu items.
58. Explain the difference between sub procedure and a function procedure.
59. What’s difference between ByRef and ByVal? Explain with an example.
60. What is the value of Flags property of the common dialog box?
61. What is purpose of using Filter property of a common dialog control?
62. What are event procedures and how are they different from user-defined
procedures.
63. What is modal form and how it is different from a modeless form?
64. What is a “startup form”?
65. What is the difference between “Load” and “Activate” events for a form?
66. Explain in detail the Show method for a form.
67. Explain in detail the Hide method for a form.
68. Explain the meaning of “Me” keyword.
69. How to refer to objects and their properties from another form in the current
form?
70. What are static variables? How are they defined in VB?
71. What are global variables? What are public variables? Explain the difference
between them.
72. What are the different styles of combo box?
73. How a list box gets filled up with items?
74. Explain the AddItem method for a list box.
75. Explain the ListIndex property and the Index property for a listbox.
76. Explain the RemoveItem method for a list box.
77. Explain the “Change” event of a combo box.
78. Explain the “Do…. Loop” statements along with an example.
79. Explain “For…. Next” statements along with an example.
80. Explain the “Exit for” statement.
81. What are various icons, which can be displayed on a message box? (Critical msg,
warning msg, warning query, information msg)
82. What are the various buttons that can be placed on a message box? Also write
their combinations.
2

T.Y.I.T
83. Explain the following functions along with an example.
 Left
 Mid
 Right
 Len
 Instr
 Sqrt
 Date
 Time
 Now
 Asc
 Chr
 Spc
 Trim
 Rtrim, Ltrim
 LOF

84. Explain the “SelStart”, “SelLength” properties of a textbox.
85. What is a control array? How to create a control array of a command buttons.
86. Explain the syntax of “Select Case” structure.
87. What are different ways in which an array can be declared?
88. What is a user defined data type? How it is declared?
89. What are property procedures for a class?
90. What is a Property Get procedure?
91. What is a Property Let procedure?
92. How to instantiate an object? (Making use of new keyword, set statement)
93. How to dimension an object without using a New keyword?
94. When is Initialize Event and the Terminate Event for a class triggered?
95. What is an Initialize Event of a class?
96. What is a Terminate Event of a class?
97. What is meaning of the following statement: Set <object name>=Nothing
98. What do you mean by File organization? What are the 2 common file organization
techniques?
99. Explain the “Open” statement along with its syntax for a data file.
100.Explain the “Close” statement along with its syntax for a data file.
101.Explain the FreeFile function.
102.How to read data from a sequential file?
103.What are the various modes in which a file can be opened for writing onto it?
104.What are various modes in which a sequential file can be opened?
105.What are various ways in which data is written onto a file (write, print)
106.What is the function used to find the end of the file?
107.Explain the error trapping process.
108.Explain the “On Error” statement with all its forms.
109. What is an “Err” object?
110.Explain the properties for an Err object. (Source, number, description)
111. Explain the Raise method along with examples.
112. Explain the Open statement for opening a random access file.
113. Explain the “Get” statement” along with its syntax.
3

T.Y.I.T
114. Explain the “Put” statement” along with its syntax.
115. Explain the difference between LOF function and EOF function.
116. Explain the difference between LOF function and the FreeFile function.
117. Explain the difference between Output and Append mode.
118. What are data-bound controls? Give few examples of data-bound controls.
119. What are the various properties for a data control?
120. Explain what is a RecordsetType property for a data control? What are the
various types of recordset available?
121. Explain what all properties of a text box must be set to make it work as a databound control. (datasource, datafield)
122. What are various record navigation methods, which are there for a recordset
object?
123. Explain the BOF and EOF properties of a recordset object.
124. Explain the difference between AddNew and Edit methods for a recordset
object.
125. Explain the Update method for a recordset object.
126. Explain the Delete method for a recordset object.
127. Explain the difference between Update and CancelUpdate methods for a
recordset object.
128. How can you check for the user deleting the only record in a Recordset?
129. Explain the “NoMatch” method and in what all situations it is used?
130. Explain the various “Find” methods for a recordset object.
131. Explain the “Seek” method for a recordset object.

4