From the course: Windows Presentation Foundation: 2 Layout
Unlock the full course today
Join today to access over 22,400 courses taught by industry experts or purchase this course individually.
Work with grid column and row sizes
From the course: Windows Presentation Foundation: 2 Layout
Work with grid column and row sizes
- [Instructor] You have control over the size of your rows and the size of the columns in the grid. Here's my example. I'm working with this grid. It has three rows defined and it has three columns defined. To set the row size you use what's called the height property. And to set the column size use the width property. Now, everything I'm showing you will be in the columns, but all the principles I'm talking about will also apply to row definitions. Right now, I haven't specified any width for the column definition. So, I'm using the default which is called Star Size or propotional sizing, and that means that each of the three columns is in proportion to the other two columns. They're all the same width. I can control over the width property by typing in a new value here and I'll start by showing the fixed size. So, I'll type in 60 and that's pixels, and so this is 60 pixels wide, and you'll notice that all three elements that are in column zero are now 60 pixels wide and you can if…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
Understand layout and child elements3m 15s
-
Use the LetterBox custom project4m 21s
-
Explore the layout panels3m 12s
-
Use the StackPanel5m 42s
-
Use the WrapPanel5m 1s
-
Use the DockPanel4m 42s
-
Use the UniformGrid3m 24s
-
Explore columnar layout with the grid6m 5s
-
Work with grid column and row sizes6m 49s
-
Add grid rows and columns with the designer4m 22s
-
Size grid rows and columns with the designers6m
-
Position grid child elements with the designer4m 13s
-
Make sizeable grid cells with the GridSplitter7m 57s
-
Absolute positioning with the Canvas3m 28s
-
Scrolling content with the ScrollViewer3m 3s
-
Use a TabControl3m 27s
-
-
-
-