1
我一直在構建一個包含媒體播放器的小型WPF應用程序。除了一部分,我幾乎完成了,讓玩家全屏。我已經到了隱藏Windows任務欄的位置,玩家正在覆蓋所有內容,除了任務欄位置。所以玩家是全屏的,除了任務欄通常在哪裏,你只能看到桌面背景的一部分。如何使我的WPF應用程序全屏
private void Full_Click(object sender, RoutedEventArgs e)
{
this.WindowStyle = WindowStyle.None;
this.ResizeMode = ResizeMode.NoResize;
this.WindowState = WindowState.Maximized;
Taskbar.Hide();
player.Stretch = Stretch.Fill;
controlPanel.Visibility = Visibility.Collapsed;//hides media controls
player.Height = System.Windows.SystemParameters.PrimaryScreenHeight + 200;//I tried to set the height to fill the entire screen
Full.Visibility = Visibility.Hidden;//hides full screen control //Im aware that may be too large of an increase but I
CloseFull.Visibility = Visibility.Visible;//shows exit control //wanted to see if it would work at all
}
您嘗試設置maxheight然後高度? – WPFUser
嗨,如果Nawed的答案解決了問題,請將其標記爲「已接受」,即使您找到了替代解決方案。您也可以將備用解決方案作爲您自己問題的答案發布,以幫助想要做同樣事情的其他人。 –