Disabled
にVertical
Orientation
とVerticalScrollbarVisibility
セットでListBox
ItemsPanelTemplate
にWrapPanel
を使用して、私は水平方向にマウスホイールでの私のコンテンツをスクロールすることはできません。リストボックスwrappanelスクロール垂直方向の向きWPF
ListBoxを水平方向にスクロールできるように表示したいが、項目はウィンドウの高さに対して上下に表示されるようにしたい。主な問題は、私はマウスでスクロールすることはできませんです
1 4 7 10
2 5 8 11 ...
3 6 9 12
以下のよう
項目は、このように表示されます。スクロールバーを使用すると、キーボードの選択を使用してうまく動作します。
は、ここで私は
<ListBox ItemContainerStyle="{StaticResource ResourceKey=ContainerStyle}" Background="{StaticResource StaticBackground}" ItemsSource="{Binding ListSource}" ScrollViewer.VerticalScrollBarVisibility="Disabled">
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel Orientation="Vertical" ScrollViewer.VerticalScrollBarVisibility="Disabled"/>
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
</ListBox>
Flow of data from top to bottom with horizontal orientation
やったことだ、これが私のItemContainerStyle
<Style TargetType="{x:Type ListBoxItem}" x:Key="ContainerStyle">
<Setter Property="ContentTemplate" Value="{StaticResource DT_TestTemplate}" />
<Setter Property="SnapsToDevicePixels" Value="True" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ListBoxItem">
<Border x:Name="Border"
Margin="5,5,5,5"
SnapsToDevicePixels="true">
<Border.Background>
<SolidColorBrush Color="Transparent" />
</Border.Background>
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="SelectionStates">
<VisualState x:Name="Unselected" >
<Storyboard>
<ColorAnimationUsingKeyFrames Storyboard.TargetName="Border"
Storyboard.TargetProperty="(Panel.Background).
(SolidColorBrush.Color)">
<EasingColorKeyFrame KeyTime="0"
Value="White" />
</ColorAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="Selected">
<Storyboard>
<ColorAnimationUsingKeyFrames Storyboard.TargetName="Border"
Storyboard.TargetProperty="(Panel.Background).
(SolidColorBrush.Color)">
<EasingColorKeyFrame KeyTime="0"
Value="#FFF34235" />
</ColorAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
<VisualState x:Name="SelectedUnfocused">
<Storyboard>
<ColorAnimationUsingKeyFrames Storyboard.TargetName="Border"
Storyboard.TargetProperty="(Panel.Background).
(SolidColorBrush.Color)">
<EasingColorKeyFrame KeyTime="0"
Value="#FFF34235" />
</ColorAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<ContentPresenter />
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="IsSelected" Value="True" >
<!--<Setter Property="ContentTemplate" Value="{StaticResource DT_TestTemplateSelectedItem}" />-->
<Setter Property="BorderBrush" Value="Transparent" />
</Trigger>
</Style.Triggers>
</Style>
である私はそれがマウスホイールをスクロールさせるために何をしますか?
明確ではないので質問を明確にしてください。 – Aybe