0% found this document useful (0 votes)
41 views8 pages

Gui Suggestions

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
41 views8 pages

Gui Suggestions

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

Unit 2

2 mark:

1. What are methods in the context of form controls?


2. Define event handling in an application.
3. Explain the purpose of an event in a control.
4. What is the purpose of a Panel in form design?
5. What is the difference between simple and complex applications?
6. What is the purpose of a LinkLabel in forms?
7. How is a PictureBox used in forms?
8. How do methods differ from events in programming?

4 mark:

1. Explain how CheckBox and RadioButton controls work in a form. Provide an example of when
each would be appropriate to use.
2. Describe the process of creating and managing a form in a simple application. How do
TextBox, Label, and Button controls interact with user input?
3. Discuss the differences between ListBox and ComboBox. How can each control be used in a
form to enhance user interaction?
4. What is the role of a Button control in event-driven programming? Illustrate with an example
of event handling.
5. What are DateTimePicker and TreeView controls? Discuss their uses and provide examples of
common events associated with them.
6. What is the significance of the Timer control in application development? Provide an
example demonstrating its use.

6 mark:

1. What are methods and events in the context of GUI programming? Explain with examples
how event handling works for RadioButton and Timer controls in an application.
2. What are Dialog Boxes in Windows Forms? Explain the use and significance of
OpenFileDialog, SaveFileDialog, and FontDialog.
3. Explain the process of designing menus using MenuStrip and ContextMenuStrip in an
application. How are access keys and shortcut keys implemented?

25 MCQ

1. Which of the following is NOT a 2. Which control is used to input text


control in Windows Forms? from the user in a form?

o A) TextBox o A) Label

o B) Label o B) TextBox

o C) Panel o C) PictureBox

o D)WebPage o D)Button
Answer: D) WebPage Answer: B) TextBox
3. What property of a TextBox control is 7. Which control allows the user to pick
used to make it read-only? a date and time?

o A) ReadWrite o A) DateTimePicker

o B) Enabled o B) TextBox

o C) Locked o C) Timer

o D)ReadOnly o D)LinkLabel
Answer: D) ReadOnly Answer: A) DateTimePicker

4. Which control is used to display an 8. Which of the following controls can


image in a form? be used to display a hyperlink in a
form?
o A) PictureBox
o A) Button
o B) Label
o B) LinkLabel
o C) TextBox
o C) Label
o D)Panel
Answer: A) PictureBox o D)PictureBox
Answer: B) LinkLabel
5. Which control is used to present
multiple options, and the user can 9. Which control is used to create a
select only one? collapsible list of items?

o A) CheckBox o A) ListView

o B) ListBox o B) TreeView

o C) RadioButton o C) ComboBox

o D)ComboBox o D)Panel
Answer: C) RadioButton Answer: B) TreeView

6. What is the primary difference 10. What is the main purpose of an event
between a ListBox and a ComboBox? handler in a form?

o A) ListBox allows selection of o A) To declare variables


multiple items; ComboBox
o B) To manage the form's title
does not
o C) To respond to user actions
o B) ComboBox allows selection
from a dropdown; ListBox o D)To display data
does not Answer: C) To respond to user
actions
o C) ListBox only displays
images; ComboBox displays 11. Which of the following is an example
text of an event in a Windows Forms
application?
o D) There is no difference
Answer: B) ComboBox allows o A) Button click
selection from a dropdown;
o B) Font color
ListBox does not
o C) Form height o B) OpenFileDialog

o D) Control name o C) PrintDialog


Answer: A) Button click
o D) ColorDialog
12. In a Button control, which event is Answer: B) OpenFileDialog
triggered when the button is clicked?
17. Which dialog box is used to select a
o A) ButtonPressed font style and size in a Windows
Form?
o B) Click
o A) FontDialog
o C) Load
o B) SaveFileDialog
o D) KeyDown
Answer: B) Click o C) ColorDialog

13. Which method is used to close a form o D) PrintDialog


in a Windows Forms application? Answer: A) FontDialog

o A) CloseForm() 18. Which control allows the user to


select a color from a predefined set
o B) Shut()
of colors?
o C) Exit()
o A) ColorDialog
o D) Close()
o B) ComboBox
Answer: D) Close()
o C) PictureBox
14. Which of the following controls
supports the CheckedChanged event? o D) Panel
Answer: A) ColorDialog
o A) ListBox
19. Which of the following is used to
o B) CheckBox
display a dialog to save a file?
o C) Label
o A) OpenFileDialog
o D) Timer
o B) ColorDialog
Answer: B) CheckBox
o C) SaveFileDialog
15. What event is commonly used to
initialize the form and its controls? o D) PrintDialog
Answer: C) SaveFileDialog
o A) Click
20. What dialog box is used to configure
o B) Load
printing options?
o C) Initialize
o A) FontDialog
o D) Activate
o B) PrintDialog
Answer: B) Load
o C) OpenFileDialog
16. Which dialog box control allows the
user to choose a file to open? o D) SaveFileDialog
Answer: B) PrintDialog
o A) SaveFileDialog
21. Which control is used to create a o D) F1
menu in a Windows Form? Answer: B) Alt + Key

o A) ContextMenuStrip 24. What is the purpose of an access key


in menu design?
o B) ListBox
o A) To provide a tooltip for a
o C) MenuStrip
menu item
o D) Panel
o B) To allow quick access to a
Answer: C) MenuStrip
menu item using the
22. What is the function of a keyboard
ContextMenuStrip?
o C) To store user data in the
o A) It creates a main menu bar form

o B) It creates a shortcut menu o D) To open the form in read-


(right-click menu) only mode
Answer: B) To allow quick
o C) It adds text to the form access to a menu item using
o D) It aligns controls on the the keyboard
form 25. Which property is used to define a
Answer: B) It creates a shortcut key for a menu item?
shortcut menu (right-click
menu) o A) ShortcutKeys

23. Which key combination is used to o B) KeyBindings


create a shortcut for a menu item?
o C) AccessKey
o A) Ctrl + Key
o D) ShortcutMenu
o B) Alt + Key Answer: A) ShortcutKeys

o C) Shift + Key
UNIT 3

2 marks:

1. Differentiate between a sub procedure and a function in VB.NET.


2. Explain the process of debugging and how it helps in resolving different types of errors.
3. What is an exception in VB.NET and how is it different from an error?
4. How do you handle multiple exceptions in VB.NET?
5. Explain recursion with an example of a recursive function in VB.NET.
6. What is the significance of ParamArray in VB.NET? How is it used?

4 marks:

1. Describe how arrays are declared and initialized in VB.NET. Provide an example.
2. Explain the concept of collections in VB.NET. What are the advantages of using a collection
over an array?
3. What are the major types of errors in VB.NET? Define syntax, execution, and logic errors.
4. How are strings manipulated in VB.NET? Give examples of common string functions.
5. Explain how exceptions are handled in VB.NET using Try, Catch, and Finally blocks.
6. How do you define a function in VB.NET? Give an example of a function returning a value.
7. What is a user-defined exception and how can it be created in VB.NET? Provide an example.

6 marks:

1. Discuss the different types of looping statements with example in VB.NET and explain how
they are used in decision-making processes.
2. What is the difference between passing a parameter by value and by reference? Give an
example.

25 MCQ

1. Which of the following is NOT a o Answer: b) Array


looping statement in VB.NET? 4. What is the default index of the
o a) For…Next first element in an array in
o b) While…End While VB.NET?
o c) If…Else o a) 1
o d) Do…Loop o b) 0
o Answer: c) If…Else o c) -1
2. What keyword is used to exit a o d) It depends on array type
loop prematurely in VB.NET? o Answer: b) 0
o a) Stop 5. In VB.NET, which of the
o b) Break following is used to store a
o c) Exit collection of objects of different
o d) End types?
o Answer: c) Exit o a) Dictionary
3. Which of the following is a o b) Array
mutable object in VB.NET? o c) List
o a) String o d) Object
o b) Array o Answer: d) Object
o c) Integer
o d) Char
6. What is the return type of the o a) Function
Length property of an array in o b) Def
VB.NET? o c) Sub
o a) Integer o d) Procedure
o b) Long o Answer: a) Function
o c) Short 12. Which of the following allows
o d) Double you to return a value from a
o Answer: a) Integer function in VB.NET?
7. Which of the following VB.NET o a) Exit Function
collections stores key-value o b) Return
pairs? o c) End Function
o a) List o d) Quit
o b) Queue o Answer: b) Return
o c) Stack 13. What is the purpose of using
o d) Dictionary ParamArray in a function?
o Answer: d) Dictionary o a) To pass a single value
8. What does the For Each loop do o b) To pass multiple
in VB.NET? arguments as an array
o a) Iterates through a o c) To return multiple values
collection o d) To define a recursive
o b) Iterates through numbers function
o c) Iterates through a string o Answer: b) To pass
o d) Iterates through only multiple arguments as an
arrays array
o Answer: a) Iterates through 14. In VB.NET, passing an argument
a collection by value means:
9. Which of the following o a) The function can modify
operations can be performed the original variable
using the Trim method in o b) The function works on a
VB.NET? copy of the variable
o a) Remove characters from o c) The function returns the
the beginning of a string original value
o b) Remove characters from o d) The function
the end of a string automatically returns by
o c) Remove characters from reference
both ends of a string o Answer: b) The function
o d) All of the above works on a copy of the
o Answer: d) All of the variable
above 15. Which keyword is used to define
10. Which of the following data a subroutine in VB.NET?
structures in VB.NET does NOT o a) Function
allow duplicates? o b) Procedure
o a) List o c) Sub
o b) Array o d) Def
o c) HashSet o Answer: c) Sub
o d) Dictionary 16. How do you pass an array as a
o Answer: c) HashSet function argument in VB.NET?
o a) ByRef only
11. What is the keyword used to o b) ByVal only
define a function in VB.NET? o c) ByRef or ByVal
o d) You cannot pass arrays o d) Connection error
in VB.NET functions o Answer: d) Connection
o Answer: c) ByRef or error
ByVal 21. Which type of error occurs when
17. What is a recursive function in the code violates the grammar
VB.NET? rules of VB.NET?
o a) A function that returns o a) Syntax error
multiple values o b) Runtime error
o b) A function that calls o c) Logic error
itself o d) Semantic error
o c) A function that takes o Answer: a) Syntax error
multiple arguments 22. Which of the following can cause
o d) A function that doesn’t a runtime error in VB.NET?
return any value o a) Dividing by zero
o Answer: b) A function that o b) Misspelled keywords
calls itself o c) Incorrect indentation
18. How can you define a function o d) Incorrect data types
with optional parameters in o Answer: a) Dividing by
VB.NET? zero
o a) Using the Optional 23. Which statement is used to
keyword handle exceptions in VB.NET?
o b) Using the ParamArray o a) Try…Catch
keyword o b) If…Else
o c) Using the Variant o c) Loop…End Loop
keyword o d) Case…Switch
o d) By passing arguments by o Answer: a) Try…Catch
reference 24. What is a logic error?
o Answer: a) Using the o a) Error in program syntax
Optional keyword o b) Error during code
19. What is the purpose of passing compilation
parameters by reference in o c) Error that occurs due to
VB.NET? incorrect reasoning in code
o a) To pass multiple o d) Error that occurs due to
arguments at once missing libraries
o b) To modify the original o Answer: c) Error that
variable in the calling code occurs due to incorrect
o c) To protect the variable reasoning in code
from modification 25. How can you define a user-
o d) To ensure the function defined exception in VB.NET?
does not return any value o a) By using the
o Answer: b) To modify the CreateException keyword
original variable in the o b) By inheriting from the
calling code Exception class
o c) By defining a new error
20. Which of the following is NOT a type
type of error in VB.NET? o d) By using the
o a) Syntax error CustomException keyword
o b) Execution error o Answer: b) By inheriting
o c) Logic error from the Exception class

You might also like