ListViewのスクロールをPixel単位にする
2021-03-14
VirtualizingPanel.ScrollUnit="Pixel" を設定する。
MainWindow.xaml
<Window x:Class="WpfApp19.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:WpfApp19"
mc:Ignorable="d"
Title="MainWindow" Height="250" Width="400">
<Grid>
<ListView x:Name="lstView" Margin="30" ItemsSource="{Binding arrayString}" VirtualizingPanel.ScrollUnit="Pixel">
<ListView.ItemTemplate>
<DataTemplate>
<Button Height="50" Width="100" Content="{Binding}"/>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</Grid>
</Window>
関連記事
ListViewのマウスオーバー時・選択時の色を消す
MainWindow.xaml <Window x:Class="WpfA ...
ListViewを横並びにする
MainWindow.xaml <Window x:Class="WpfA ...
ListViewの中身の幅をいっぱいに広げる
MainWindow.xaml <Window x:Class="WpfA ...
TreeViewの多階層をBindで実装、スタイルを指定する
TreeView の ItemsSource に全体の配列をBindし、 Hie ...
DataGridのセル選択枠を消す
DataGridのオプションを行選択(SelectionUnit="FullRo ...
ディスカッション
コメント一覧
まだ、コメントがありません