Note that there are some explanatory texts on larger screens.

plurals
  1. POHow can I get ScrollViewer to work inside a StackPanel?
    primarykey
    data
    text
    <p>In the following WPF XAML the ScrollViewer does not work (it displays a scroll bar but you cannot scroll and the contents go off the window to the bottom).</p> <p>I can change the outer StackPanel to a Grid and it will work.</p> <p>However, in my application from which I reproduced the following code, I need to have an outer StackPanel. <strong>What do I have to do to the StackPanel to make the ScrollViewer show a usable scrollbar?</strong> e.g. VerticalAlignment="Stretch" Height="Auto" don't work. </p> <pre><code> &lt;StackPanel&gt; &lt;ScrollViewer&gt; &lt;StackPanel&gt; &lt;TextBlock Text="This is a test"/&gt; &lt;TextBlock Text="This is a test"/&gt; &lt;TextBlock Text="This is a test"/&gt; &lt;TextBlock Text="This is a test"/&gt; &lt;TextBlock Text="This is a test"/&gt; &lt;TextBlock Text="This is a test"/&gt; &lt;TextBlock Text="This is a test"/&gt; &lt;TextBlock Text="This is a test"/&gt; &lt;TextBlock Text="This is a test"/&gt; &lt;TextBlock Text="This is a test"/&gt; &lt;TextBlock Text="This is a test"/&gt; &lt;TextBlock Text="This is a test"/&gt; &lt;TextBlock Text="This is a test"/&gt; &lt;TextBlock Text="This is a test"/&gt; &lt;TextBlock Text="This is a test"/&gt; &lt;TextBlock Text="This is a test"/&gt; &lt;TextBlock Text="This is a test"/&gt; &lt;TextBlock Text="This is a test"/&gt; &lt;TextBlock Text="This is a test"/&gt; &lt;TextBlock Text="This is a test"/&gt; &lt;TextBlock Text="This is a test"/&gt; &lt;TextBlock Text="This is a test"/&gt; &lt;TextBlock Text="This is a test"/&gt; &lt;TextBlock Text="This is a test"/&gt; &lt;TextBlock Text="This is a test"/&gt; &lt;TextBlock Text="This is a test"/&gt; &lt;TextBlock Text="This is a test"/&gt; &lt;/StackPanel&gt; &lt;/ScrollViewer&gt; &lt;/StackPanel&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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