Note that there are some explanatory texts on larger screens.

plurals
  1. POScrollbar in Listbox not working
    text
    copied!<p>I have a <code>ListBox</code> that displays a list of WPF controls. My problem is that the vertical scrollbar is show but is disabled even when there are enough items that the <code>ListBox</code> should be scrollable. One other possibly relevant fact is that this is contained in an <code>Integration.ElementHost</code>.</p> <p>WPF noobie, Jim</p> <p>Here is the XAML for the <code>ListBox</code>:</p> <pre><code> // for brevity I removed the Margin and Tooltip attributes &lt;Grid x:Class="Xyzzy.NoteListDisplay" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"&gt; &lt;StackPanel Name="stackPanel" Orientation="Vertical" ScrollViewer.VerticalScrollBarVisibility="Visible"&gt; &lt;StackPanel Orientation="Horizontal"&gt; &lt;CheckBox Name="AllRecent" IsChecked="False" &gt;View All Recent&lt;/CheckBox&gt; &lt;CheckBox Name="AscendingOrder" IsChecked="False"&gt;Descending Order&lt;/CheckBox&gt; &lt;Button Name="btnTextCopy" Click="btnCopyText_Click"&gt;Copy All&lt;/Button&gt; &lt;/StackPanel&gt; &lt;ListBox Name="NoteList" ScrollViewer.CanContentScroll="True" ScrollViewer.VerticalScrollBarVisibility="Visible"&gt; &lt;/ListBox&gt; &lt;/StackPanel&gt; &lt;/Grid&gt; </code></pre> <p>And the XAML for the control displayed in each <code>ListBox</code> item:</p> <pre><code> &lt;UserControl x:Class="Xyzzy.NoteDisplay" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"&gt; &lt;Grid&gt; &lt;StackPanel Orientation="Vertical"&gt; &lt;StackPanel Orientation="Horizontal"&gt; &lt;TextBlock Name="Heading" FontSize="10"&gt;Note Heading&lt;/TextBlock&gt; &lt;Button Name="btnCopyText" Height="20" FontSize="12" Click="btnCopyText_Click"&gt;Copy &lt;/Button&gt; &lt;/StackPanel&gt; &lt;TextBlock Name="Body" FontSize="14"&gt;Note Body&lt;/TextBlock&gt; &lt;/StackPanel&gt; &lt;/Grid&gt; &lt;/UserControl&gt; </code></pre>
 

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