<Page x:Class="WpfBrowserApplication.Page1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" mc:Ignorable="d" d:DesignHeight="300" d:DesignWidth="300" Title="Page1"> <StackPanel> <Button x:Name="btnOK" Content="클릭하시오..." /> </StackPanel> </Page> |
2. F7 통한 코드 작성
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.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes; namespace WpfBrowserApplication { /// <summary> /// Interaction logic for Page1.xaml /// </summary> public partial class Page1 : Page { public Page1() { InitializeComponent(); btnOK.Click += new RoutedEventHandler(btnOK_Click); } void btnOK_Click(object sender, RoutedEventArgs e) { MessageBox.Show(DateTime.Now.ToString()); } } } |
3. 결과 화면
'.Net Project > WPF' 카테고리의 다른 글
06. WPF AddressBook 주소록 간단 출력 응용 프로그램 작성 (0) | 2010.05.21 |
---|---|
05. WPF Windows 바탕화면 변경하기 (0) | 2010.05.21 |
04. WPF PatientReferrals (0) | 2010.05.21 |
02. WPF HelloWorld 텍스트 박스 내용 메시지 박스에 출력 (0) | 2010.05.21 |
01. WPF 시작하기 (0) | 2010.05.21 |