I have a listbox under stackpanel and vertical scrollbar is visible but the scroller is not coming. The horizontal works fine. I can scroll across the listbox but not vertically.
<ListBox Width="700" Height="205" x:Name="log_Enteries" ScrollViewer.VerticalScrollBarVisibility="Visible" ScrollViewer.HorizontalScrollBarVisibility="Visible">
</ListBox>
I know setting height and width is not wise but it was desperate try I guess.
Use
MaxHeight
of yourListBox
insteadYou can also set your
MaxHeight
to parentStackPanel
to achive want you want somthing like this:It's in a
StackPanel
. A vertically-orientedStackPanel
will give its children whatever height they ask for, even if it means they run off the screen. Hence, the verticalScrollBar
will never show. Choose the right panel and you'll see theScrollBar
.