更改主窗口显示方式
This commit is contained in:
commit
2659b01329
2 files changed
+11
-2
No files matched your search
+1
-1
@@ -13,7 +13,7 @@
|
||||
Loaded="Window_Loaded"
|
||||
Title="SUNLIGHT SCCM b0.0.1 (2024/08/10)"
|
||||
Height="1080" Width="1920" Background="#FF003640"
|
||||
WindowState ="Maximized" WindowStyle="None">
|
||||
WindowStyle="None" ResizeMode="NoResize">
|
||||
<Window.Resources>
|
||||
<Storyboard x:Key="MenuOpen">
|
||||
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.Width)" Storyboard.TargetName="GridMenu">
|
||||
|
||||
+10
-1
@@ -14,6 +14,7 @@ using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Forms;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Interop;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
@@ -35,6 +36,7 @@ namespace SunlightCentralizedControlManagement_SCCM_
|
||||
|
||||
public MainWindow()
|
||||
{
|
||||
WindowStartupLocation = WindowStartupLocation.CenterScreen;
|
||||
DataContext = new MainWindowViewModel();
|
||||
InitializeComponent();
|
||||
CountDown();
|
||||
@@ -144,7 +146,6 @@ namespace SunlightCentralizedControlManagement_SCCM_
|
||||
{
|
||||
Picture.Content = new View.DispenseView();
|
||||
}
|
||||
|
||||
private void Buttonhelp_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
WindowsView.Help help_page = new WindowsView.Help();
|
||||
@@ -242,7 +243,15 @@ namespace SunlightCentralizedControlManagement_SCCM_
|
||||
|
||||
private void Window_Loaded(object sender, RoutedEventArgs e)//打开页面
|
||||
{
|
||||
var windowHandle = new WindowInteropHelper(this).Handle;
|
||||
var currentScreen = Screen.FromHandle(windowHandle);
|
||||
|
||||
System.Drawing.Rectangle rectangle = currentScreen.WorkingArea;
|
||||
|
||||
this.Left = rectangle.Left;
|
||||
this.Top=rectangle.Top;
|
||||
this.Width = rectangle.Width;
|
||||
this.Height = rectangle.Height;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user