Home > DeveloperSection > Forums > How can I disable horizontal scrolling in a WPF listbox?
E E Cummings
E E Cummings

Total Post:26

Points:182
Posted on    July-18-2013 1:58 AM

 WPF WPF 
Ratings:


 1 Reply(s)
 3942  View(s)
Rate this:
Hi Developers!

This seems to be an absurdly simple question but Google and SO searches yield nothing. How can I disable horizontal scrolling in a WPF listbox when items take up more horizontal space than is available in the box?

thanks in advance



shreesh chandra shukla
shreesh chandra shukla

Total Post:105

Points:735
Posted on    July-18-2013 2:36 AM

Solution!

In XAML:

<ListBox ScrollViewer.HorizontalScrollBarVisibility="Disabled" />

In C#:

myListBox.SetValue(ScrollViewer.HorizontalScrollBarVisibilityProperty, ScrollBarVisibility.Disabled);



Don't want to miss updates? Please click the below button!

Follow MindStick