我有两个显示器。我想制作一个媒体播放器,我想在我的次要显示器上全屏播放视频。因此,我正在尝试使用WPF制作媒体播放器。
这是我到目前为止编写的代码:
Screen[] _screens = Screen.AllScreens;
System.Drawing.Rectangle ractagle = _screens[1].Bounds;
//player is my window
player.WindowState = WindowState.Maximized;
player.WindowStyle = WindowStyle.None;
player.Left = ractagle.X;
player.Top = ractagle.Y;
// MediaControl is an media elements
MediaControl.Height = ractagle.Height;
MediaControl.Width = ractagle.Width;
但是不知何故它只在我的第一个显示器上播放。非常感谢任何形式的帮助。