wpf - Clipping from left rather than right when there isn't enough room for a child element? -
i have grid 3 columns of width *, auto, *.
when collapse grid width using expander, want central column remain fixed size. want right hand column begin clipping right hand edge. default behaviour, , works fine. however, first column clip left-hand side. say, i'd left-hand edge of column become hidden first. left-hand column, clipping right-hand edge.
hope i've explained enough! thanks
you need set horizontalalignment="right" , ="left" appropriately.
here's example, may not match requirements exactly, clips left , right require:
<grid> <grid.columndefinitions> <columndefinition width="*"/> <columndefinition width="auto"/> <columndefinition width="*"/> <columndefinition width="auto"/> <columndefinition width="auto"/> </grid.columndefinitions> <textblock grid.column="0" text="left hand column" horizontalalignment="right"/> <rectangle grid.column="1" fill="blue" width="100"/> <textblock grid.column="2" text="right hand column" horizontalalignment="left"/> <gridsplitter grid.column="3" width="4" verticalalignment="stretch" resizebehavior="previousandnext"/> <rectangle grid.column="4" fill="red"/> </grid>
Comments
Post a Comment