첨부 소스 코드는 나눔고딕코딩 폰트를 사용합니다.
728x90
반응형
728x170

TestProject.zip
다운로드

▶ MainWindow.xaml

<Window x:Class="TestProject.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Width="800"
    Height="600"
    Title="Window 클래스 : WindowStyle 속성 사용하기"
    FontFamily="나눔고딕코딩"
    FontSize="16">
    <Grid>
    </Grid>
</Window>

 

728x90

 

▶ MainWindow.xaml.cs

using System.Windows;

namespace TestProject
{
    /// <summary>
    /// 메인 윈도우
    /// </summary>
    public partial class MainWindow : Window
    {
        //////////////////////////////////////////////////////////////////////////////////////////////////// Constructor
        ////////////////////////////////////////////////////////////////////////////////////////// Public

        #region 생성자 - MainWindow()

        /// <summary>
        /// 생성자
        /// </summary>
        public MainWindow()
        {
            InitializeComponent();

            Application.Current.ShutdownMode = ShutdownMode.OnMainWindowClose;

            Loaded += Window_Loaded;
        }

        #endregion

        //////////////////////////////////////////////////////////////////////////////////////////////////// Method
        ////////////////////////////////////////////////////////////////////////////////////////// Private

        #region 윈도우 로드시 처리하기 - Window_Loaded(sender, e)

        /// <summary>
        /// 윈도우 로드시 처리하기
        /// </summary>
        /// <param name="sender">이벤트 발생자</param>
        /// <param name="e">이벤트 인자</param>
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            Window window1 = new Window();

            window1.Owner       = this;
            window1.Left        = Left;
            window1.Top         = Top + 20 + SystemParameters.WindowCaptionHeight;
            window1.Width       = 400;
            window1.Height      = 300 - SystemParameters.WindowCaptionHeight;
            window1.WindowStyle = WindowStyle.None;
            window1.Title       = nameof(WindowStyle.None);

            Window window2 = new Window();

            window2.Owner       = this;
            window2.Left        = Left + 400;
            window2.Top         = Top  + 20 + SystemParameters.WindowCaptionHeight;
            window2.Width       = 400;
            window2.Height      = 300 - SystemParameters.WindowCaptionHeight;
            window2.WindowStyle = WindowStyle.SingleBorderWindow;
            window2.Title       = nameof(WindowStyle.SingleBorderWindow);

            Window window3 = new Window();

            window3.Owner       = this;
            window3.Left        = Left;
            window3.Top         = Top + 300 + SystemParameters.WindowCaptionHeight;
            window3.Width       = 400;
            window3.Height      = 300 - SystemParameters.WindowCaptionHeight;
            window3.WindowStyle = WindowStyle.ThreeDBorderWindow;
            window3.Title       = nameof(WindowStyle.ThreeDBorderWindow);

            Window window4 = new Window();

            window4.Owner       = this;
            window4.Left        = Left + 400;
            window4.Top         = Top  + 300 + SystemParameters.WindowCaptionHeight;
            window4.Width       = 400;
            window4.Height      = 300 - SystemParameters.WindowCaptionHeight;
            window4.WindowStyle = WindowStyle.ToolWindow;
            window4.Title       = nameof(WindowStyle.ToolWindow);

            window1.Show();
            window2.Show();
            window3.Show();
            window4.Show();
        }

        #endregion
    }
}
728x90
반응형
그리드형(광고전용)
Posted by icodebroker

댓글을 달아 주세요