1

我有这段代码可以在后面的 Menu.xaml 代码(Menu.xaml.vb)上创建一个列表框:

            Dim mm As New ListBox()
            AddHandler mm.SelectionChanged, AddressOf Me.ListBox_SelectionChanged

            mm.FontSize = 20
            Dim nn As New ListBoxItem
            nn.Content = "NOTIFICATIONS:"
            nn.Foreground = Brushes.White
            nn.Background = Brushes.DarkSlateBlue
            nn.FontSize = 44
            nn.FontWeight = FontWeights.Bold

            mm.Items.Add(nn)

现在我想禁用滚动,或者在其他情况下隐藏滚动条,但是如果我检查 mm 属性,则没有对 Scroll 的引用

任何帮助或线索?

提前致谢

4

1 回答 1

3
ScrollViewer.SetHorizontalScrollBarVisibility(mm, ScrollBarVisibility.Disabled);
ScrollViewer.SetVerticalScrollBarVisibility(mm, ScrollBarVisibility.Disabled);
于 2013-02-14T15:30:16.433 回答