调整列大小时,WPF ListView游标不会更改

时间:2013-12-13 20:49:26

标签: wpf listview

当鼠标位于标题列中以调整列宽时,光标不会更改。列确实调整大小,但光标仍保持为箭头。

ListView控件不执行此操作吗?如果是这样,如何在光标大小调整大小时让光标改变?

    <ListView Name="Listing" 
                 Grid.Row="1" Grid.Column="2" 
                 Margin="0,0,0,0"
                 FontSize="12" 
                 HorizontalAlignment="Stretch" 
                 VerticalAlignment="Stretch" 
                 SelectionChanged="ListView_SelectionChanged" 
                 MouseDoubleClick="ListView_MouseDoubleClick"
        >
        <ListView.ItemContainerStyle>
            <Style TargetType="ListViewItem">
                <Setter Property="Height" Value="22" />
                <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
            </Style>
        </ListView.ItemContainerStyle>
        <ListView.View>
            <GridView>
                <GridViewColumn DisplayMemberBinding="{Binding Name}" Width="180">
                    <GridViewColumn.Header>
                        <GridViewColumnHeader Content="File" HorizontalContentAlignment="Left"/>
                    </GridViewColumn.Header>
                </GridViewColumn>

                <GridViewColumn Width="100" >
                    <GridViewColumn.Header>
                        <GridViewColumnHeader Content="Size" HorizontalContentAlignment="Left"/>
                    </GridViewColumn.Header>                        
                    <GridViewColumn.CellTemplate >
                        <DataTemplate>
                            <TextBlock Text="{Binding Length, StringFormat={}{0:#\,##0;(#\,##0); }}" TextAlignment="Right" HorizontalAlignment="Stretch"/>
                        </DataTemplate>
                    </GridViewColumn.CellTemplate>
                </GridViewColumn>

                <GridViewColumn DisplayMemberBinding="{Binding LastWriteTime, StringFormat={}{0:yyyy.MMM.dd h:mm tt}}" Width="140">
                    <GridViewColumn.Header>
                        <GridViewColumnHeader Content="Date Modified" HorizontalContentAlignment="Left"/>
                    </GridViewColumn.Header>
                </GridViewColumn>

                <GridViewColumn DisplayMemberBinding="{Binding FileType}" Width="180">
                    <GridViewColumn.Header>
                        <GridViewColumnHeader Content="Type" HorizontalContentAlignment="Left"/>
                    </GridViewColumn.Header>
                </GridViewColumn>
            </GridView>
        </ListView.View>
    </ListView>

0 个答案:

没有答案