블로그 이미지
Magic_kit
study 관련자료를 한곳으로 자기 개발 목적으로 재태크 재무 관리 목적으로 일상생활의 팁을 공유 하기 위하여 블로그를 개설 하였습니다.

calendar

1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
반응형

Category

Recent Post

Recent Comment

Archive

2010. 5. 21. 01:29 .Net Project/WPF
반응형
1. 화면 UI 구성

<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. 결과 화면
 




반응형
posted by Magic_kit