forms - WPF - Resizing Columns and Rows in a Grid -


OK, I am using the grid to list different content. How can I get to change the size of the specific colors, while others remain static

That is, for the controls, phosphos with special initial column sizes ... if the user forms the reserve Does ... want me some 'memo' to expand the fields like How to do it I think only 'all' should be able to expand the other columns in height ... not only 1 (the last one) ... or the specific ones.

Thanks for any help!

This is the layout ... How can I shape the 'long' text with changing the size of the form, and I can put the button pasted on the bottom of this form ??? Tx

  & lt; DocPanel Vertical Element = "Top" & gt; & Lt; Grid Dock Panel. Doc = "top" vertical alignment = "top" horizontal align = "stretch" grid. Column = "0" margin = "10,10,10,10" & gt; & Lt; Grid.ColumnDefinitions & gt; & Lt; Column define width = "auto" & gt; & Lt; / ColumnDefinition & gt; & Lt; Column define minway = "150" & gt; & Lt; / ColumnDefinition & gt; & Lt; /Grid.ColumnDefinitions> & Lt; Grid.RowDefinitions & gt; & Lt; RowDefinition & gt; & Lt; / RowDefinition & gt; & Lt; Row Definition Minhite = "80" Height = "Auto" & gt; & Lt; / RowDefinition & gt; & Lt; RowDefinition & gt; & Lt; / RowDefinition & gt; & Lt; /Grid.RowDefinitions> & Lt; Label grid Column = "0" grid. Line = "0" content = "test1" /> & Lt; Label grid Column = "0" grid. Line = "1" content = "test 2-log notes" /> & Lt; Label grid Column = "0" grid. Line = "2" content = "test3" /> & Lt; Text box height = "auto" grid Column = "1" grid. Line = "0" /> & Lt; Text box height = "auto" grid Column = "1" grid. Line = "1" textwapping = "wrap" accepts return = "true" verticalscrollbar electricityability = "auto" /> & Lt; Text box height = "auto" grid Column = "1" grid. Line = "2" /> & Lt; / Grid & gt; & Lt; Stackpaneel dockpanel.doc = "bottom" orientation = "horizontal" horizontal align = "true" minhite = "20" margin = "0,0,10,10" & gt; & Lt; Button content = "OK" margin = "0,0,10,0" width = "75" IsDefault = "True" /> & Lt; Button Content = "Cancel" width = "75" IsCancel = "True" /> & Lt; / StackPanel & gt; & Lt; / DockPanel & gt;  

(1 was added after 'Answer') Now, if I remove the stackpanel (ok, cancel button) below the equation to make it easier and I will get 1 and 2 Fixed values ​​set the rows ... I seem to be able to do this work (though not set to max height) ... Oh and I have to change the vertical alignment for 'stretch'. But as soon as I add the steakpanel for the button ... now it is not the work of pulling ... so this is the next revised version ...

   & Lt; Label grid Column = "0" grid. Line = "1" content = "test 2-log notes" /> & Lt; Label grid Column = "0" grid. Line = "2" content = "test3" /> & Lt; Text box grid Column = "1" grid. Line = "0" /> & Lt; Text box grid Column = "1" grid. Line = "1" texterpreking = "wrap" accepts return = "true" vertical scrollbar = "auto" /> & Lt; Text Box Grid Column = "1" grid. Rau = "2" /> & Lt; / Grid & gt; & Lt; StackPanel DockPanel.Dock = "Down" WorkspaceElement = "Down" Horizontal Alignment = "True" Orientation = "Horizontal" Minhite = "20" Margin = "0,0,10,10" & gt; & Lt; Button content = "OK" margin = "0,0,10,0" width = "75" IsDefault = "True" /> & Lt; Button Content = "Cancel" width = "75" IsCancel = "True" /> & Lt; / StackPanel & gt; & Lt; / DockPanel & gt;  

So I still have problems ...

Use * for column width instead of auto, which tells columns which are left after the other columns are set up.

If you need multiple columns to share the available space in different percentages, then you can prefix * with a number, such as "2 *" and "3 *" default By definition, "" 1 means

HTH, Beryllle


Comments