Expression Blend Example Chinese tutorial (5)-Quick start of layout controls Stackpanel,scrollviewer and border
The previous article describes the use of the canvas layout control in blend. This article continues to describe the layout controls Stackpanel,scrollviewer and border.
Compared to grid and canvas, stackpanel,scrollviewer and border are simpler layout controls, and the functionality is relatively singular.
First of all, say StackPanel control. The meaning of the stack panel is understood literally. All content within the stack is arranged in order, arranged in a horizontal and vertical way.
For StackPanel use, the control is arranged horizontally or vertically, using the control to arrange controls that are much easier to control than the grid Setup table.
For example, to set the row and column in grid, and then place the control in each cell, you can achieve the effect of aligning the layout, while in StackPanel you can use the Orientation property control.
Here we have a brief demonstration of the application of StackPanel in blend
When StackPanel is selected, draw a StackPanel container in the main window.
Then select the button control, and in StackPanel, draw a button with a height of 30. Then select the button, copy create three new buttons, and when you copy and paste, you will find that each time you create a new button, it will automatically flow down in the layout. Unlike grid and canvas, copying and pasting controls in grid and canvas automatically overwrites the previous control and requires ZIndex control over its location.