From 52f3b3488261f7f8ce08e6f386e7635d9f7b9aaf Mon Sep 17 00:00:00 2001 From: syneffort Date: Mon, 19 Jun 2023 13:53:21 +0900 Subject: [PATCH] window startup basic --- PacticeSolution/PacticeSolution.sln | 25 ++++++++ PacticeSolution/PacticeSolution/App.xaml | 9 +++ PacticeSolution/PacticeSolution/App.xaml.cs | 17 ++++++ .../PacticeSolution/AssemblyInfo.cs | 10 ++++ .../PacticeSolution/Children/ChildWindow.xaml | 12 ++++ .../Children/ChildWindow.xaml.cs | 27 +++++++++ .../PacticeSolution/MainWindow.xaml | 15 +++++ .../PacticeSolution/MainWindow.xaml.cs | 59 +++++++++++++++++++ .../PacticeSolution/PacticeSolution.csproj | 10 ++++ 9 files changed, 184 insertions(+) create mode 100644 PacticeSolution/PacticeSolution.sln create mode 100644 PacticeSolution/PacticeSolution/App.xaml create mode 100644 PacticeSolution/PacticeSolution/App.xaml.cs create mode 100644 PacticeSolution/PacticeSolution/AssemblyInfo.cs create mode 100644 PacticeSolution/PacticeSolution/Children/ChildWindow.xaml create mode 100644 PacticeSolution/PacticeSolution/Children/ChildWindow.xaml.cs create mode 100644 PacticeSolution/PacticeSolution/MainWindow.xaml create mode 100644 PacticeSolution/PacticeSolution/MainWindow.xaml.cs create mode 100644 PacticeSolution/PacticeSolution/PacticeSolution.csproj diff --git a/PacticeSolution/PacticeSolution.sln b/PacticeSolution/PacticeSolution.sln new file mode 100644 index 0000000..c55e02a --- /dev/null +++ b/PacticeSolution/PacticeSolution.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.5.33530.505 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PacticeSolution", "PacticeSolution\PacticeSolution.csproj", "{6AE700B8-28D0-4D9F-978B-91AFB1033125}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {6AE700B8-28D0-4D9F-978B-91AFB1033125}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6AE700B8-28D0-4D9F-978B-91AFB1033125}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6AE700B8-28D0-4D9F-978B-91AFB1033125}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6AE700B8-28D0-4D9F-978B-91AFB1033125}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {92FAC045-5C95-49EC-8241-6E62578C29E2} + EndGlobalSection +EndGlobal diff --git a/PacticeSolution/PacticeSolution/App.xaml b/PacticeSolution/PacticeSolution/App.xaml new file mode 100644 index 0000000..003aef4 --- /dev/null +++ b/PacticeSolution/PacticeSolution/App.xaml @@ -0,0 +1,9 @@ + + + + + diff --git a/PacticeSolution/PacticeSolution/App.xaml.cs b/PacticeSolution/PacticeSolution/App.xaml.cs new file mode 100644 index 0000000..bd8af68 --- /dev/null +++ b/PacticeSolution/PacticeSolution/App.xaml.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Configuration; +using System.Data; +using System.Linq; +using System.Threading.Tasks; +using System.Windows; + +namespace PacticeSolution +{ + /// + /// Interaction logic for App.xaml + /// + public partial class App : Application + { + } +} diff --git a/PacticeSolution/PacticeSolution/AssemblyInfo.cs b/PacticeSolution/PacticeSolution/AssemblyInfo.cs new file mode 100644 index 0000000..8b5504e --- /dev/null +++ b/PacticeSolution/PacticeSolution/AssemblyInfo.cs @@ -0,0 +1,10 @@ +using System.Windows; + +[assembly: ThemeInfo( + ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located + //(used if a resource is not found in the page, + // or application resource dictionaries) + ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located + //(used if a resource is not found in the page, + // app, or any theme specific resource dictionaries) +)] diff --git a/PacticeSolution/PacticeSolution/Children/ChildWindow.xaml b/PacticeSolution/PacticeSolution/Children/ChildWindow.xaml new file mode 100644 index 0000000..e04ac3b --- /dev/null +++ b/PacticeSolution/PacticeSolution/Children/ChildWindow.xaml @@ -0,0 +1,12 @@ + + + + + diff --git a/PacticeSolution/PacticeSolution/Children/ChildWindow.xaml.cs b/PacticeSolution/PacticeSolution/Children/ChildWindow.xaml.cs new file mode 100644 index 0000000..502c903 --- /dev/null +++ b/PacticeSolution/PacticeSolution/Children/ChildWindow.xaml.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Shapes; + +namespace PacticeSolution.Children +{ + /// + /// ChildWindow.xaml에 대한 상호 작용 논리 + /// + public partial class ChildWindow : Window + { + public ChildWindow() + { + InitializeComponent(); + } + } +} diff --git a/PacticeSolution/PacticeSolution/MainWindow.xaml b/PacticeSolution/PacticeSolution/MainWindow.xaml new file mode 100644 index 0000000..3995b09 --- /dev/null +++ b/PacticeSolution/PacticeSolution/MainWindow.xaml @@ -0,0 +1,15 @@ + + + + + + + + diff --git a/PacticeSolution/PacticeSolution/MainWindow.xaml.cs b/PacticeSolution/PacticeSolution/MainWindow.xaml.cs new file mode 100644 index 0000000..9fa2117 --- /dev/null +++ b/PacticeSolution/PacticeSolution/MainWindow.xaml.cs @@ -0,0 +1,59 @@ +using PacticeSolution.Children; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace PacticeSolution +{ + /// + /// Interaction logic for MainWindow.xaml + /// + public partial class MainWindow : Window + { + public MainWindow() + { + InitializeComponent(); + } + + private void btnOwner_Click(object sender, RoutedEventArgs e) + { + ChildWindow child = new ChildWindow(); + child.Owner = this; + child.WindowStartupLocation = WindowStartupLocation.CenterOwner; + child.Show(); + } + + private void btnScreen_Click(object sender, RoutedEventArgs e) + { + ChildWindow child = new ChildWindow(); + child.WindowStartupLocation = WindowStartupLocation.CenterScreen; + child.Show(); + } + + private void btnManual_Click(object sender, RoutedEventArgs e) + { + ChildWindow child = new ChildWindow(); + child.WindowStartupLocation = WindowStartupLocation.Manual; + child.Show(); + } + + private void btnTopMost_Click(object sender, RoutedEventArgs e) + { + ChildWindow child = new ChildWindow(); + child.Background = Brushes.LightCyan; + child.Topmost = true; + child.Show(); + } + } +} diff --git a/PacticeSolution/PacticeSolution/PacticeSolution.csproj b/PacticeSolution/PacticeSolution/PacticeSolution.csproj new file mode 100644 index 0000000..4106cb0 --- /dev/null +++ b/PacticeSolution/PacticeSolution/PacticeSolution.csproj @@ -0,0 +1,10 @@ + + + + WinExe + net6.0-windows + enable + true + + +