블로그 이미지
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:22 .Net Project/WPF
반응형
1. 화면 UI 디자인

<Window x:Class="WpfHelloWorld.MainWindow"

        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

        Title="MainWindow" Height="350" Width="525">

    <Grid>

        <Grid.RowDefinitions>

            <RowDefinition Height="30"></RowDefinition>

            <RowDefinition Height="*"></RowDefinition>

            <RowDefinition Height="30"></RowDefinition>

        </Grid.RowDefinitions>

        <TextBox Name="txtMessage" Grid.Row="0" Margin="5, 5, 5, 5" />

        <Button Name="btnOK" Content="" Grid.Row="2" />

    </Grid>

</Window> 


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 WpfHelloWorld

{

    /// <summary>

    /// Interaction logic for MainWindow.xaml

    /// </summary>

    public partial class MainWindow : Window

    {

        public MainWindow()

        {

            InitializeComponent();

 

            btnOK.Click += new RoutedEventHandler(btnOK_Click);

        }

 

        void btnOK_Click(object sender, RoutedEventArgs e)

        {

            MessageBox.Show(txtMessage.Text);

        }

    }

} 


3. 결과 화면 입니다...



 





MessageBox.Show ("텍스트박스내용")
을 다음과 같이 출력해주고 있습니다..
반응형
posted by Magic_kit