The layout of WPF Program Development and the layout of wpf Program Development

Source: Internet
Author: User

The layout of WPF Program Development and the layout of wpf Program Development

UniformGrid: Special Grid. All cells are of the same size.

Canvas: similar to the canvas of html5, it can also be laid out based on coordinates like winform.

Grid: The table of the webpage

GridSplitter: The Separator in the Grid. You can drag it to adjust the size.

<GridSplitter Grid.Row="1" HorizontalAlignment="Stretch" Height="10" Background="Blue" Grid.ColumnSpan="3"/>

// ShowsPreview = "True" drag and drop will not be adjusted immediately, the mouse is released to adjust, DragIncrement = "10" each drag width

// Note: Set Auto for Col or Row of the Grid to adjust the value based on the Content size.

 

SharedSizeGroup: Share size in Grid

Add additional attributes in the outer layout of the GridGrid. IsSharedSizeScope = "True" sets the allowable alignment size.

Set in the required ColumnSharedSizeGroup = "abc" to align

<StackPanel Grid. isSharedSizeScope = "True"> <Grid x: Name = "LayoutRoot_grid1" ShowGridLines = "True" Background = "Cornsilk"> <Grid. columnDefinitions> <ColumnDefinition Width = "Auto" SharedSizeGroup = "abc"/> <ColumnDefinition Width = "Auto"/> <ColumnDefinition/> </Grid. columnDefinitions> <Label Margin = "5"> ceshishisshw a long text article determines that the price of the house is a waste of Aston on the price of the southern part of the city where I love you. column = "1"> moretext </Label> <Label Grid. column = "2" Margin = "2"> it is the card swipe fee in the room in Lhasa </Label> </Grid> <Grid x: name = "LayoutRoot_grid2" ShowGridLines = "True" Background = "Azure"> <Grid. columnDefinitions> <ColumnDefinition Width = "Auto" SharedSizeGroup = "abc"/> <ColumnDefinition/> </Grid. columnDefinitions> <Label Margin = "5"> Aston waste </Label> <Label Grid. column = "1"> moretext </Label> </Grid> </StackPanel>

Effect:

 

Grid of the UniformGrid rule

Specify the rows and columns to create a frame of the same size. // you have used this Grid to create a small game like 2048.

 

InkCanvas (Advanced Development)

EditingMode attributes:

1. Ink (default value of EditingMode)-draw a stroke with the mouse or pointer.
2. InkAndGesture-the same as Ink, but can also recognize users' gestures. The list of gestures (Up, Down, Circle, ScratchOut, and Tap) is saved in the System. Windows. Ink. ApplicationGesture Enumeration type.
3. GestureOnly-only recognizes gestures and does not draw strokes you enter.
4. EraseByStroke (default value of EditingModeInverted) -- erase a stroke when it is touched.
5. EraseByPoint-only erase the stroke part directly touched (like a traditional pencil eraser ).
6. Select-When triggered, Select a stroke or any UIElement so that they can be deleted, moved, or adjusted within the InkCanvas range.
7. None-no response is made to the mouse or pointer.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.