728x90
728x170
▶ 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"
WindowStyle="None"
Width="800"
Height="600"
Title="Window 클래스 : 테두리 없는 윈도우 드래그 하기"
AllowsTransparency="True"
Background="#eff0f0">
<Grid>
</Grid>
</Window>
728x90
▶ MainWindow.xaml.cs
using System.Windows;
using System.Windows.Input;
namespace TestProject
{
/// <summary>
/// 메인 윈도우
/// </summary>
public partial class MainWindow : Window
{
//////////////////////////////////////////////////////////////////////////////////////////////////// Constructor
////////////////////////////////////////////////////////////////////////////////////////// Public
#region 생성자 - MainWindow()
/// <summary>
/// 메인 윈도우
/// </summary>
public MainWindow()
{
InitializeComponent();
this.MouseLeftButtonDown += Window_MouseLeftButtonDown;
}
#endregion
//////////////////////////////////////////////////////////////////////////////////////////////////// Method
////////////////////////////////////////////////////////////////////////////////////////// Private
#region 윈도우 마우스 왼쪽 버튼 DOWN 처리하기 - Window_MouseLeftButtonDown(sender, e)
/// <summary>
/// 윈도우 마우스 왼쪽 버튼 DOWN 처리하기
/// </summary>
/// <param name="sender">이벤트 발생자</param>
/// <param name="e">이벤트 인자</param>
private void Window_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
DragMove();
}
#endregion
}
}
728x90
그리드형(광고전용)
'C# > WPF' 카테고리의 다른 글
[C#/WPF] 정육면체 애니메이션 만들기 (0) | 2016.06.26 |
---|---|
[C#/WPF] 코드로 삼각형 3D 만들기 (0) | 2016.06.26 |
[C#/WPF] 사각형 2개 만들기 (0) | 2016.06.26 |
[C#/WPF] 투시도법 직육면체 만들기 (0) | 2016.06.26 |
[C#/WPF] 정사도법 직육면체 만들기 (0) | 2016.06.26 |
[C#/WPF] Window 클래스 : 투명 윈도우 만들기 (0) | 2016.02.03 |
[C#/WPF] Window 클래스 : 투명 윈도우 만들기 (0) | 2016.02.03 |
[C#/WPF] ScrollViewer 클래스 : ScrollChanged 이벤트를 사용해 그리드 컨트롤 흉내내기 (0) | 2016.02.03 |
[C#/WPF] InputManager 클래스 : 키 이벤트 발생시키기 (0) | 2016.01.24 |
[C#/WPF] Keyboard 클래스 : CTRL+C 키 입력 처리하기 (0) | 2016.01.24 |