Visual Programming MCQs with Answers
Practice important Visual Programming MCQs with answers and explanations.
Chapter: 22
Q441:
What is the purpose of the aboutdialog_mouserightbuttondown method in the aboutdialog class?
A. To display event information and toggle border of control
B. To handle button click events
C. To initialize the window
D. To handle listbox selection changes
Correct Answer:
A
Chapter: 22
Q442:
In the aboutdialog class, what type of event does listbox_selectionchanged handle?
A. Mouse button events
B. Keyboard events
C. Listbox selection changes
D. Button click events
Correct Answer:
C
Chapter: 22
Q443:
What does base.OnKeyDown(e); do in the OnKeyDown method?
A. Calls the base class method to handle key down event
B. Sets a keyboard focus to the element
C. Initializes the key event
D. Raises a key event
Correct Answer:
A
Chapter: 22
Q444:
What does the Button_Click method in the aboutdialog class display?
A. The source of a button click event
B. The current mouse position
C. The selected item in a listbox
D. The title of the window
Correct Answer:
A
Chapter: 22
Q445:
What is the purpose of KeyboardDevice.IsKeyDown method?
A. To check if a specific key is pressed
B. To get the state of all keys
C. To set the keyboard focus
D. To handle key events
Correct Answer:
A
Chapter: 22
Q446:
What does e.KeyboardDevice.Modifiers & ModifierKeys.Alt check for?
A. Whether the Alt key is pressed
B. Whether the Ctrl key is pressed
C. Whether the Shift key is pressed
D. Whether the Windows key is pressed
Correct Answer:
A
Chapter: 22
Q447:
Which of the following events is NOT a mouse event?
A. MouseEnter
B. MouseLeave
C. MouseWheel
D. TouchDown
Correct Answer:
D
Chapter: 22
Q448:
What is the function of Mouse.Capture in WPF?
A. Captures the mouse input for an element
B. Releases the mouse capture from an element
C. Sets the mouse position to a specific element
D. Initializes mouse event handling
Correct Answer:
A
Chapter: 22
Q449:
How does a ListBox handle selection changes if the listbox_selectionchanged event is defined?
A. It will not handle selection changes
B. It displays a message about the selected item
C. It changes the background color of selected items
D. It toggles the visibility of the ListBox
Correct Answer:
B
Chapter: 22
Q450:
What does the PreviewMouseMove event do?
A. It handles the mouse movement event before it bubbles up
B. It handles the mouse movement event after it bubbles up
C. It captures the mouse movement event
D. It handles the mouse movement event directly on the source
Correct Answer:
A
Chapter: 22
Q451:
Which event is called when a user clicks a button?
A. Click
B. MouseDown
C. MouseUp
D. MouseClick
Correct Answer:
A
Chapter: 22
Q452:
How are manipulation events for panning, rotating, and zooming typically applied?
A. Using direct mouse events
B. Using touch events
C. Using transform operations
D. Using standard key events
Correct Answer:
C
Chapter: 22
Q453:
What is the significance of e.OriginalSource in event handling?
A. It represents the element that initially raised the event
B. It represents the element that currently has the focus
C. It is the same as e.Source
D. It is always null
Correct Answer:
A
Chapter: 22
Q454:
What is the role of AddHandler in event handling?
A. To add an event handler for a routed event
B. To remove an event handler for a routed event
C. To create a new event handler
D. To initialize an event
Correct Answer:
A
Chapter: 22
Q455:
How does PreviewTouchDown differ from TouchDown?
A. It is a tunneling event
B. It is a bubbling event
C. It only triggers on the source
D. It handles touch events for multi-touch devices
Correct Answer:
A
Chapter: 22
Q456:
What does IsKeyboardFocused property indicate?
A. Whether an element has keyboard focus
B. Whether an element has mouse focus
C. Whether an element is visible
D. Whether an element is currently selected
Correct Answer:
A
Chapter: 23
Q457:
What does the ontouchdown method do in the mainwindow class?
A. Captures the touch device and adds an image to the canvas
B. Initializes the touch device and sets up event handlers
C. Moves the image to the touch point on the canvas
D. Releases the touch device capture
Correct Answer:
A
Chapter: 23
Q458:
In the ontouchmove method, what is checked before moving the image?
A. Whether the touch device is captured by the canvas
B. Whether the touch device is in the dictionary
C. Whether the touch device is active
D. Whether the touch device is in the fingerprints dictionary
Correct Answer:
A
Chapter: 23
Q459:
What event is raised when the user lifts their finger from the touch screen in WPF?
A. ontouchup
B. ontouchmove
C. ontouchdown
D. ontouchcancel
Correct Answer:
A
Chapter: 23
Q460:
What is the purpose of Canvas.CaptureTouch in the ontouchdown method?
A. To capture touch input for the canvas
B. To initialize touch input for the canvas
C. To release touch capture from the canvas
D. To add a new touch point image to the canvas
Correct Answer:
A