How can I disable horizontal scrolling in a WPF ListBox?
If you created the Listbox from codebehind and want to make the change in XAML:
<UserControl.Resources>
<Style TargetType="{x:Type ListBox}" x:Key="{x:Type ListBox}" >
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Hidden" />
</Style>
</UserControl.Resources>
In XAML:
<ListBox ScrollViewer.HorizontalScrollBarVisibility="Disabled" />
In C#:
myListBox.SetValue(
ScrollViewer.HorizontalScrollBarVisibilityProperty,
ScrollBarVisibility.Disabled);