Dev/WPF

    [WPF] Brush 사용

    ////방법 1 //Color color = Color.FromRgb(0, 0, 0); //SolidColorBrush solidColorBrush = new SolidColorBrush(color); ////방법 2 //SolidColorBrush solidColorBrush = new SolidColorBrush(Color.FromRgb(0, 0, 0)); ////방법 3 //SolidColorBrush solidColorBrush = new SolidColorBrush(); //solidColorBrush.Color = Color.FromRgb(0, 0, 0); //방법 4 SolidColorBrush solidColorBrush = new SolidColorBrush(Colors.Black); t..

    [WPF] 프로그램 활성화/비활성화 체크

    //응용 프로그램이 포그라운드 응용 프로그램이 될 때 발생한다. Application.Current.Activated += new EventHandler(Current_Activated); //응용 프로그램이 더 이상 포그라운드가 아닐 때 발생한다. Application.Current.Deactivated += new EventHandler(Current_Deactivated);

    [WPF] 창을 화면의 우측하단 영역에 위치시키기

    //창을 화면의 우측하단 영역에 위치시키기 this.Left = SystemParameters.WorkArea.Width - this.Width; this.Top = SystemParameters.WorkArea.Height - this.Height; ////창을 작업 영역의 중앙에 위치시키기 //this.Left = (SystemParameters.WorkArea.Width/2) - this.Left; //this.Top = (SystemParameters.WorkArea.Height/2) - this.Top;

    [WPF] 단일 인스턴트 응용 프로그램

    이미 실행중인 프로그램일때 새로운 응용프로그램은 종료시켜보자. 위와 같이 처리 후 아래와 같이 Mutex를 이용하여 같은 응용프로그램이 있는지 체크하여 실행/종료 using System.Windows; using System.Threading; namespace WpfApplication2 { /// /// App.xaml에 대한 상호 작용 논리 /// public partial class App : Application { Mutex mutex; protected override void OnStartup(StartupEventArgs e) { base.OnStartup(e); string mutexName = "InstanceName"; bool createdNew; mutex = new Mutex(..

    [WPF] App.xaml StartupUri -> cs사용

    App.xaml 파일을 보면 시작페이지를 지정하는 코드(StartupUri)가 있다. 이 부분을 cs파일에서 구현해보자. using System; using System.Collections.Generic; using System.Configuration; using System.Data; using System.Linq; using System.Windows; namespace WpfApplication3 { /// /// App.xaml에 대한 상호 작용 논리 /// public partial class App : Application { protected override void OnStartup(StartupEventArgs e) { base.OnStartup(e); Window1 window =..