Visual Programming MCQs with Answers
Practice important Visual Programming MCQs with answers and explanations.
Chapter: 19
Q401:
How does the GridLength constructor with GridUnitType.Star affect a Grid?
A. It allows the size to be proportional to the remaining space.
B. It sets the size to a fixed number of pixels.
C. It adjusts the size based on the content.
D. It sizes the element to fit its container.
Correct Answer:
A
Chapter: 19
Q402:
What effect does a GridSplitter have on a Grid layout?
A. It allows interactive resizing of rows or columns.
B. It positions elements within a grid cell.
C. It changes the alignment of grid elements.
D. It adds or removes rows and columns.
Correct Answer:
A
Chapter: 19
Q403:
What is the default alignment of a GridSplitter in a Grid?
A. Horizontal alignment = Right, Vertical alignment = Stretch
B. Horizontal alignment = Center, Vertical alignment = Center
C. Horizontal alignment = Stretch, Vertical alignment = Bottom
D. Horizontal alignment = Left, Vertical alignment = Top
Correct Answer:
A
Chapter: 19
Q404:
When using proportional sizing with * in Grid, how does 2* compare to 1*?
A. 2* takes twice as much space as 1*.
B. 2* takes half as much space as 1*.
C. 2* takes the same amount of space as 1*.
D. 2* takes no space compared to 1*.
Correct Answer:
A
Chapter: 19
Q405:
What does setting GridLength to Auto mean for row or column sizing?
A. The size adjusts automatically based on the content.
B. The size is set to a fixed number of pixels.
C. The size is proportional to the remaining space.
D. The size is not set and remains flexible.
Correct Answer:
A
Chapter: 19
Q406:
What does the GridLength constructor new GridLength(100) specify?
A. An absolute size of 100 pixels.
B. A proportional size relative to the remaining space.
C. An automatic size based on content.
D. A size of 100 units of Star sizing.
Correct Answer:
A
Chapter: 19
Q407:
What does the GridSplitter property ResizeDirection control?
A. It determines whether the splitter resizes rows or columns.
B. It sets the size of the splitter.
C. It specifies the color of the splitter.
D. It adjusts the alignment of the splitter.
Correct Answer:
A
Chapter: 19
Q408:
When multiple elements are placed in the same cell of a Grid, what determines their visibility?
A. The z-order of the elements.
B. The alignment of the elements.
C. The size of the cell.
D. The content of the cell.
Correct Answer:
A
Chapter: 20
Q409:
What does the Width="Auto" attribute do in a Grid.ColumnDefinition?
A. Sets the column width to fit the content automatically.
B. Sets the column width to a fixed value.
C. Sets the column width to fill the remaining space.
D. Sets the column width to the maximum value possible.
Correct Answer:
A
Chapter: 20
Q410:
What is the purpose of the GridSplitter in a Grid layout?
A. It allows interactive resizing of columns or rows.
B. It sets the alignment of elements within a Grid.
C. It changes the color of the grid lines.
D. It adjusts the padding of grid cells.
Correct Answer:
A
Chapter: 20
Q411:
How does SharedSizeGroup affect the sizing of columns in a Grid?
A. It ensures that columns with the same SharedSizeGroup remain the same width when resized.
B. It makes all columns in the grid have the same width regardless of content.
C. It automatically adjusts the row heights based on content.
D. It hides the grid lines of columns in the shared size group.
Correct Answer:
A
Chapter: 20
Q412:
What does the isSharedSizeScope attribute do in a Grid?
A. It allows size groups to be shared across multiple grids within the same parent.
B. It specifies the alignment of elements within a Grid.
C. It controls whether a grid will have a scroll bar.
D. It sets the width of the columns to be equal across all grids.
Correct Answer:
A
Chapter: 20
Q413:
How is clipping different from trimming in WPF?
A. Clipping cuts off parts of the UI element that exceed its bounds, while trimming intelligently handles text overflow.
B. Clipping hides all parts of the UI element, while trimming only affects the edges.
C. Clipping scales the UI element, while trimming adjusts its alignment.
D. Clipping changes the color of the UI element, while trimming changes its size.
Correct Answer:
A
Chapter: 20
Q414:
Which property determines whether a ScrollViewer displays vertical or horizontal scroll bars?
A. VerticalScrollBarVisibility and HorizontalScrollBarVisibility
B. ScrollBarVisibility
C. ScrollViewerVisibility
D. Visibility
Correct Answer:
A
Chapter: 20
Q415:
What does the Viewbox control do in WPF?
A. It scales its single child element to fit the available space according to the specified stretch options.
B. It allows scrolling within a specific area of the view.
C. It provides a clipping area for UI elements.
D. It arranges child elements in a wrap layout.
Correct Answer:
A
Chapter: 20
Q416:
What is the default stretch mode of a Viewbox?
A. Uniform
B. Fill
C. None
D. UniformToFill
Correct Answer:
A
Chapter: 20
Q417:
What does the StretchDirection property of a Viewbox control?
A. It specifies whether the scaling should affect width only, height only, or both dimensions.
B. It determines the alignment of the Viewbox within its parent.
C. It sets the margin around the Viewbox.
D. It defines the opacity of the Viewbox.
Correct Answer:
A
Chapter: 20
Q418:
How does the GridLength property in XAML affect the size of columns or rows?
A. It specifies the size in absolute units, auto-sizing, or proportional space.
B. It only sets the size of columns, not rows.
C. It automatically adjusts the size based on the content.
D. It only affects the padding of the grid cells.
Correct Answer:
A
Chapter: 20
Q419:
In a Grid, what does setting Width="Auto" do when using GridLength?
A. It adjusts the width of the column to fit the content inside.
B. It makes the column width equal to the total width of the grid.
C. It sets a fixed width for the column.
D. It makes the column width proportional to the grid size.
Correct Answer:
A
Chapter: 20
Q420:
What effect does setting ClipToBounds to False have on a Canvas?
A. It allows drawing outside the bounds of the canvas.
B. It restricts drawing within the bounds of the canvas.
C. It sets the size of the canvas to the bounds of its parent.
D. It hides the canvas itself from view.
Correct Answer:
A