Visual Programming MCQs with Answers
Practice important Visual Programming MCQs with answers and explanations.
Multiple Choice Questions
Q361: In the XAML example, which property is used to set the font size of a TextElement?
- A: FontSize
- B: TextSize
- C: Size
- D: TextElementFontSize
View Answer
A
Q362: What is the equivalent C# code to set the FontSize of a TextElement?
- A: TextElement.SetFontSize(element, 30);
- B: TextElement.SetFontSize(30);
- C: TextElement.SetFontSize(element, value);
- D: TextElement.FontSizeProperty.SetValue(element, 30);
View Answer
C
Q363: How do you register an attached property in WPF?
- A: DependencyProperty.RegisterAttached
- B: DependencyProperty.AddOwner
- C: DependencyProperty.Register
- D: DependencyProperty.Create
View Answer
A
Q364: Which method is used to set the value of an attached property in WPF?
- A: SetValue
- B: SetAttachedValue
- C: UpdateValue
- D: AssignValue
View Answer
A
Q365: What does the FrameworkPropertyMetadataOptions.Inherits option specify for a dependency property?
- A: The property value is inherited by child elements.
- B: The property value is static and cannot be changed.
- C: The property value is read-only.
- D: The property value can only be set programmatically.
View Answer
A
Q366: What is the purpose of the Tag property in WPF elements?
- A: To store arbitrary custom data.
- B: To set the visibility of an element.
- C: To determine the type of the element.
- D: To define default property values.
View Answer
A
Q367: How does the Visibility property differ between Collapsed and Hidden in WPF?
- A: Collapsed does not participate in layout; Hidden does participate in layout.
- B: Collapsed is visible; Hidden is invisible.
- C: Collapsed means the element is not rendered; Hidden means the element is rendered but invisible.
- D: Collapsed means the element is invisible but still takes up space; Hidden means the element is not rendered and does not take up space.
View Answer
A
Q368: What is the default value for HorizontalAlignment in a Button control?
- A: Left
- B: Center
- C: Stretch
- D: Right
View Answer
A
Q369: Which property is used to control the space inside the edges of a Control element?
- A: Padding
- B: Margin
- C: Spacing
- D: Inset
View Answer
A
Q370: What does the FlowDirection property affect in WPF?
- A: The direction in which text and layout flow.
- B: The size of the layout containers.
- C: The visibility of elements in the layout.
- D: The rendering quality of elements.
View Answer
A