Visual Programming MCQs with Answers
Practice important Visual Programming MCQs with answers and explanations.
Multiple Choice Questions
Q431: What is the purpose of EventManager.RegisterRoutedEvent in WPF?
- A: It registers a routed event so that it can be handled by event handlers.
- B: It creates a new UI element in the visual tree.
- C: It registers a custom dependency property.
- D: It sets the visibility of an event source.
View Answer
A
Q432: What are RoutedEvents in WPF?
- A: Events that can traverse up or down the visual or logical tree.
- B: Events that are only triggered by user interactions.
- C: Events that are specific to a single UI element.
- D: Standard .NET events that do not participate in routing.
View Answer
A
Q433: How does the PreviewMouseRightButtonDown event differ from MouseRightButtonDown?
- A: PreviewMouseRightButtonDown is a tunneling event that occurs before MouseRightButtonDown.
- B: PreviewMouseRightButtonDown occurs after MouseRightButtonDown.
- C: PreviewMouseRightButtonDown only applies to text input, not mouse events.
- D: MouseRightButtonDown is a bubbling event that occurs before PreviewMouseRightButtonDown.
View Answer
A
Q434: What does the Click event in the Button class do?
- A: It is a routed event that handles button click actions.
- B: It only handles mouse clicks on the button's border.
- C: It manages changes to the button's visual appearance.
- D: It handles keyboard input when the button is focused.
View Answer
A
Q435: In the MainWindow code, what does the pane1pin_Click method do?
- A: It toggles the visibility of Pane 1 between docked and undocked states.
- B: It initializes the size of Pane 1.
- C: It changes the background color of Pane 1.
- D: It hides Pane 1 when the mouse enters it.
View Answer
A
Q436: How is Layer0 used in the provided XAML and code?
- A: It acts as a base layer that adjusts column definitions when panes are docked or undocked.
- B: It manages the visibility of the buttons in the StackPanel.
- C: It handles the click events for the buttons in the interface.
- D: It defines the layout for the Menu in the DockPanel.
View Answer
A
Q437: What does the pane1button_mouseenter event handler do?
- A: It shows Pane 1 and hides Pane 2 if Pane 2 is undocked.
- B: It changes the text color of Pane 1.
- C: It adjusts the alignment of Pane 1 within the DockPanel.
- D: It resizes Pane 1 to fit the content.
View Answer
A
Q438: How does Layer1 visibility change when toggling Pane 1?
- A: It is set to Collapsed when Pane 1 is docked and Visible when undocked.
- B: It is set to Visible when Pane 1 is docked and Collapsed when undocked.
- C: It remains always Visible regardless of the docking state.
- D: It changes its visibility based on the time of day.
View Answer
B
Q439: What does the pane2pin_Click method do in the MainWindow class?
- A: It toggles the visibility of Pane 2 between docked and undocked states.
- B: It initializes the size of Pane 2.
- C: It sets the color of Pane 2 to white.
- D: It hides Pane 2 when the mouse enters it.
View Answer
A
Q440: What does e.Source represent in an event handler?
- A: The logical tree element that originally raised the event.
- B: The visual tree element that originally raised the event.
- C: The source of the event as defined by the system.
- D: The UI element that is currently focused.
View Answer
A