In the grid layout , what the difference between the followings
Width="auto"开发者_StackOverflow
Width ="*"
Width ="100*"
Width="auto"
Autosizing: Gives child elements the space they need - in case of a grid column, makes the column as wide as the widest contained element.
Width ="*"
Width = "100*"
Proportional sizing or "star sizing": Divide the available space proportionally. For example, in order to divide the available into two columns at 20% and 80% of the grid width, you could use "20*"/"80*"
or "2*"/"8*"
or even "*"/"4*"
. "*"
is equivalent to "1*"
.
The size can be specified as an absolute amount of logical units, as a percentage value or automatically.
Fixed Fixed size of logical units (1/96 inch)
Auto Takes as much space as needed by the contained control
Star (*) Takes as much space as available, percentally divided over all star-sized columns. Star-sizes are like percentages, except that the sum of all star columns does not have to be 100%. Remember that star-sizing does not work if the grid size is calculated based on its content.
for more
http://www.wpftutorial.net/GridLayout.html
精彩评论