小编D.K*_*.K.的帖子

wpf中的双显示器双窗口应用程序

我正在尝试使用media元素创建一个wpf视频播放器.我的目标是为该应用程序制作多个窗口.每个窗口都会显示在不同的显示器上.就像MainWindow将获得主显示器的分辨率并调整自身以全屏显示.辅助监视器上的第二个窗口等等......

到目前为止,我已经在主显示器上制作了MainWindow全屏.但我不知道如何用它的分辨率在第二台显示器上显示第二个窗口.请帮忙.

c# wpf multiple-monitors

2
推荐指数
1
解决办法
9178
查看次数

wpf scrollviewer鼠标滚轮不适用于stackpanel

我有一个用scrollviewer包装的堆栈面板。在堆栈面板内部,我有一些网格,而在网格内部,又有堆栈面板,MahApps Metro还提供了一些磁贴控件。

如果我拖动滚动条,scrollviewer可以正常工作。但鼠标滚轮不起作用。可能是某些控件正在窃取鼠标滚轮操作,但我无法确定哪一个。我试着在滚动条上滚动鼠标滚轮。但仍然无法正常工作。

<ScrollViewer x:Name="TS" Grid.Row="1" HorizontalAlignment="Stretch" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Disabled" CanContentScroll="True" PanningMode="HorizontalOnly" SnapsToDevicePixels="True" Background="Transparent">
    <StackPanel x:Name="TilesPanel" VerticalAlignment="Top" HorizontalAlignment="Stretch" Orientation="Horizontal">
        <StackPanel.Resources>
            <Style TargetType="{x:Type Grid}">
                <Setter Property="Margin" Value="0,50,0,0"/>
            </Style>
        </StackPanel.Resources>
        <Separator Background="{x:Null}" Width="110"></Separator>
        <Grid>
            <StackPanel>
                <StackPanel Orientation="Horizontal">
                    <StackPanel.Resources>
                        <Style TargetType="{x:Type Grid}">
                            <Setter Property="Margin" Value="10,0,0,0"/>
                        </Style>
                    </StackPanel.Resources>
                    <Grid Height="260">
                        <StackPanel>
                            <StackPanel.Resources>
                                <Style TargetType="{x:Type StackPanel}">
                                    <Setter Property="Margin" Value="0,0,0,10"/>
                                </Style>
                            </StackPanel.Resources>
                        <StackPanel Width="247" Height="119">
                            <Custom:Tile x:Name="Mail" Margin="0" Width="auto" d:LayoutOverrides="Height">
                                <Image Stretch="Fill" Source="Res/AppTiles/Mail.png"/>
                            </Custom:Tile>
                        </StackPanel>

                        //and it goes on like this//

                        </grid>
                      </stackpanel>
                <Separator Background="{x:Null}" Width="50"/>
            </Grid> …
Run Code Online (Sandbox Code Playgroud)

c# mousewheel scrollviewer stackpanel wpf-4.0

0
推荐指数
2
解决办法
8669
查看次数