title: WPF ListBox: Vertical scrollbar and focus
body: <p>I have two problems regarding a ListBox/WrapPanel.</p>
  
  <p>First of all, my setup:
  In XAML I have a ListBox. Inside of the ListBox is a WrapPanel. Programatically I add ListBoxItems to the WrapPanel.</p>
  
  <p><strong>Problem one</strong></p>
  
  <p>The ListBoxItems [StackPanel with Image and TextBlock] fills left to right and up to down. However, a vertical scrollbar does not appear if there are more ListBoxItems than there is space in the ListBox. The following XAML code makes the vertical scrollbar visible. However, it remains disabled:</p>
  
  <pre><code>&lt;ListBox Name="li1StandortLinks" Background="Transparent" MaxHeight="300" ScrollViewer.VerticalScrollBarVisibility="Visible"&gt;
      &lt;WrapPanel Name="wp1StandortLinks" ItemHeight="80" ItemWidth="150" Width="755" /&gt;
  &lt;/ListBox&gt;
  </code></pre>
  
  <p>How to get a functional vertical scrollbar when needed?</p>
  
  <p><strong>Problem two</strong></p>
  
  <p>When clicking into the ListBox but not at a ListBoxItem [for example, in between two of them], the background of the whole ListBox gets highlighted in blue. Initially the background is transparent and it should remain like this even if the ListBox itself was clicked. Catching the Click-Event and setting the background back to transparent seems not to help. The blue highlight-color does disappear, but instead of the ListBox background going back to transparent, it then remains grey.
  Can I change the style so that the color does not change at all when clicking at the ListBox? I never really changed styles in WPF, though, so I'd need a precise explaination.</p>