Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I hide a listviews Vertrical Scroll bar on UWP?

So I am trying to hide the vertical scroll bar of a ListView in my UWP application programatically in code.

I have tried looking at the MSDN documentation for Windows.UI.Xaml.Controls.ListView

But can't see a property. All I can find is the property ShowsScrollingPlaceholders which states:

Gets or sets a value that indicates whether the view shows placeholder UI for items during scrolling.

But setting:

(Control as Windows.UI.Xaml.Controls.ListView).ShowsScrollingPlaceholders = false;

does nothing.

So is it possible to hide the Vertical scroll bar on a listview using UWP?

like image 416
User1 Avatar asked Dec 11 '22 17:12

User1


1 Answers

In Xaml you can do the following:

<ListView ScrollViewer.VerticalScrollBarVisibility="Hidden"></ListView>

and in code you can do:

Windows.UI.Xaml.Controls.ScrollViewer.SetVerticalScrollBarVisibility((Control as Windows.UI.Xaml.Controls.ListView), Windows.UI.Xaml.Controls.ScrollBarVisibility.Hidden);
like image 65
User1 Avatar answered Jan 08 '23 16:01

User1