Note that there are some explanatory texts on larger screens.

plurals
  1. POTextbox will not stretch to fill viewbox
    text
    copied!<p>I want the font size of my labels and textboxes in my LOB form to grow and shrink with window resize or resolution change. To achieve this I've placed my labels and textboxes within viewboxes.</p> <p>The labels and custom radio buttons behave as I expect, but the textboxes will not stretch horizontally to fill the viewbox (sorry can't post image because of rep). The textboxes will horizontally fill the viewbox if you type into them.</p> <p>Here is an example of the code which I am working with:</p> <pre><code> &lt;Grid&gt; &lt;Grid.ColumnDefinitions&gt; &lt;ColumnDefinition Width="0.186*"/&gt; &lt;ColumnDefinition Width="0.814*"/&gt; &lt;/Grid.ColumnDefinitions&gt; &lt;Grid.RowDefinitions&gt; &lt;RowDefinition Height="0.127*"/&gt; &lt;RowDefinition Height="0.873*"/&gt; &lt;/Grid.RowDefinitions&gt; &lt;Viewbox Margin="0,0,0.917,0"&gt; &lt;Label Content="First name:"/&gt; &lt;/Viewbox&gt; &lt;Viewbox Grid.Column="1"&gt; &lt;TextBox TextWrapping="Wrap"/&gt; &lt;/Viewbox&gt; &lt;/Grid&gt; </code></pre> <p>I've tried placing grid, stackpanel and dockpanel (with LastChildFill="True") within the viewbox and then placing the textboxes within these layout controls but this didn't work either. Is there anyway to get the textboxes to horizontally fill the parent viewbox? </p> <p>This problem is similar to this: <a href="https://stackoverflow.com/questions/3737077/wpf-textbox-wont-fill-in-stackpanel">WPF TextBox won&#39;t fill in StackPanel</a> but this problem is with stackpanels, not viewboxes.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload