Xamarin.WPFでフルスクリーン表示をしたいのですが、タスクバーが表示されたままになってしまいます。
C#
1public void EnterFullScreen() 2{ 3 Visibility = System.Windows.Visibility.Collapsed; 4 System.Windows.Controls.Grid partCommandBar = this.Template.FindName("PART_CommandsBar", this) as System.Windows.Controls.Grid; 5 if (partCommandBar != null) 6 { 7 partCommandBar.Visibility = System.Windows.Visibility.Collapsed; 8 } 9 ResizeMode = System.Windows.ResizeMode.NoResize; 10 WindowState = System.Windows.WindowState.Maximized; 11 Topmost = true; 12 13 var topAppBar = this.Template.FindName("PART_TopAppBar", this) as WpfLightToolkit.Controls.LightAppBar; 14 if (topAppBar != null) 15 { 16 topAppBar.Visibility = System.Windows.Visibility.Collapsed; 17 } 18 19 Visibility = System.Windows.Visibility.Visible; 20}
WPFでは以下のコードでタスクバーの手前に表示できました。
C#
1 Visibility = Visibility.Collapsed; 2 WindowStyle = WindowStyle.None; 3 ResizeMode = ResizeMode.NoResize; 4 WindowState = WindowState.Maximized; 5 Topmost = true; 6 Visibility = Visibility.Visible;
user32.dll のAPIも使ってみましたが、タスクバーが表示されたままです。
C#
1 [DllImport("user32")] 2 private static extern bool SetWindowPos(IntPtr hWnd, IntPtr insertAfter, int x, int y, int cx, int cy, int uFlags); 3 4 var helper = new System.Windows.Interop.WindowInteropHelper(this); 5 6 IntPtr HWND_TOPMOST = new IntPtr(-1); 7 SetWindowPos(helper.Handle, HWND_TOPMOST, 0, 0, 0, 0, 0x0010 | 0x0002 | 0x0400 | 0x0001 | 0x0040);
どうやればタスクバーの手前に表示することが出来るのでしょうか。
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2019/03/05 04:16
2019/03/05 07:42
2019/03/05 07:52
2019/03/06 00:00
2019/03/06 04:44