본문 바로가기
반응형

→ 개발/WPF13

[WPF] DispatcherTimer 타이머 DispatcherTimer timer; //함수1 내부 timer = new DispatcherTimer(); timer.Interval = TimeSpan.FromSeconds(10); timer.Tick += new EventHandler(timer_Tick); timer.Start(); //함수1 내부 끝 void timer_Tick(object sender, EventArgs e) { sbTest = (Storyboard)(wc.FindResource("SbBasicBgDown")); sbTest.Begin(); timer.Stop(); } 2010. 11. 17.
[WPF C#] 새로띄운 창(유저컨트롤)에서 값, 버튼 이벤트 가져오기 지금 프로젝트를 유저컨트롤로 만들고 다른 프로젝트에 넣을 것 입니다. 그리고 여기에 보이는 "바로가기" 버튼을 누르면 다음과 같이 새로운 프로젝트에서 버튼 이벤트를 받아서 받은값 (여기에서는 1 을 받았습니다.)을 메세지 박스로 띄우겠습니다. 지금 보시는 화면에서 "뷰어/에디터"에 있는 바로가기 버튼 Name은 "ViwerButton" 입니다. - 유저 컨트롤로 만든 프로젝트 소스 - using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Windows; using System.Windows.Controls; using System.Windows.Data; using System.Wi.. 2010. 8. 6.
[WPF] 키보드 키 눌렀을때 어떤키인지 알아보자! KeyDown 이벤트 발생 private void LoginWindow1_KeyDown(object sender, KeyEventArgs e) { if (Keyboard.GetKeyStates(Key.Enter) == KeyStates.Down) { MessageBox.Show("엔터키를 누르셨군요"); } } 2010. 7. 19.
[WPF] 콤보박스에서 아이템 선택시 문자열 가져오기 selectionchanged 이벤트 발생 private void EventList_SelectionChanged(object sender, SelectionChangedEventArgs e) { ComboBox currentComboBox = sender as ComboBox; if (currentComboBox != null) { ComboBoxItem currentItem = currentComboBox.SelectedItem as ComboBoxItem; if (currentItem != null) { MessageBox.Show(currentItem.Content.ToString()); } } } 참고 : 훈스닷넷 2010. 7. 14.
반응형