728x90
반응형
728x170
▶ MainApplication.cs
using System.Windows;
namespace TestProject
{
/// <summary>
/// 메인 애플리케이션
/// </summary>
public class MainApplication : Application
{
//////////////////////////////////////////////////////////////////////////////////////////////////// Method
////////////////////////////////////////////////////////////////////////////////////////// Protected
#region 시작시 처리하기 - OnStartup(e)
/// <summary>
/// 시작시 처리하기
/// </summary>
/// <param name="e">이벤트 인자</param>
protected override void OnStartup(StartupEventArgs e)
{
base.OnStartup(e);
MainWindow window = new MainWindow();
window.Show();
}
#endregion
}
}
728x90
▶ MainWindow.cs
using System.Windows;
using System.Windows.Input;
namespace TestProject
{
/// <summary>
/// 메인 윈도우
/// </summary>
public class MainWindow : Window
{
//////////////////////////////////////////////////////////////////////////////////////////////////// Constructor
////////////////////////////////////////////////////////////////////////////////////////// Public
#region 생성자 - MainWindow()
/// <summary>
/// 생성자
/// </summary>
public MainWindow()
{
Title = "Application, Window 클래스 상속하기";
Width = 800;
Height = 600;
}
#endregion
//////////////////////////////////////////////////////////////////////////////////////////////////// Method
////////////////////////////////////////////////////////////////////////////////////////// Protected
#region 마우스 다운시 처리하기 - OnMouseDown(e)
/// <summary>
/// 마우스 다운시 처리하기
/// </summary>
/// <param name="e">이벤트 인자</param>
protected override void OnMouseDown(MouseButtonEventArgs e)
{
base.OnMouseDown(e);
string message = string.Format
(
"Window clicked with {0} button at point ({1})",
e.ChangedButton,
e.GetPosition(this)
);
MessageBox.Show(message, Title);
}
#endregion
}
}
728x90
반응형
그리드형(광고전용)
'C# > WPF' 카테고리의 다른 글
[C#/WPF] FrameworkElement 클래스 : 커스텀 엘리먼트 사용하기 (0) | 2018.03.10 |
---|---|
[C#/WPF] RadialGradientBrush 클래스 사용하기 (0) | 2018.03.10 |
[C#/WPF] LinearGradientBrush 클래스 : MappingMode 속성 사용하기 (0) | 2018.03.10 |
[C#/WPF] Type 클래스 : GetProperties 메소드 사용하기 (0) | 2018.03.10 |
[C#/WPF] Window 클래스 : Background 속성을 사용해 배경색 변경하기 (0) | 2018.03.10 |
[C#/WPF] XAML에서 특수 문자 사용하기 (0) | 2018.03.04 |
[C#/WPF] MediaElement 클래스 사용하기 (0) | 2018.02.18 |
[C#/WPF] RotateTransform 엘리먼트 : 마우스 진입시 이미지 회전하기 (0) | 2018.02.18 |
[C#/WPF] DoubleAnimation 엘리먼트 : 스크롤 슬라이드 사용하기 (0) | 2018.02.18 |
[C#/WPF] 이미지 뒤집기 (0) | 2018.02.18 |
댓글을 달아 주세요