Answer the question
In order to leave comments, you need to log in
How to stretch a canvas element to its entire remaining width?
Hello. I am writing a desktop application for Windows using WPF. The layout is something like this:
<StackPanel Orientation="Horizontal">
<StackPanel Orientation="Vertical">
</StackPanel>
<Canvas RenderTransformOrigin="0.5, 0.5">
<Canvas.RenderTransform>
<ScaleTransform ScaleY="-1" />
</Canvas.RenderTransform>
</Canvas>
</StackPanel>
Answer the question
In order to leave comments, you need to log in
Turn a horizontally oriented StackPanel i.e. the one in which you have the canvas in the DockPanel (the Orientation tag will need to be removed). Then your canvas, as the last of the children, will take up all the remaining available area (default behavior). Plus, it will be logical - after all, your control controls should be docked on the left, so it's more logical to use DockPanel.
Happy New Year!
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question