WpfHelloWorld
.NET프로그래밍/WPF 2010. 1. 5. 16:14 |- WPF Application - 윈도우즈 애플리케이션 (닷넷프레임워크 깔려있어야 함)
- WPF Browser Application - 웹 애플리케이션 (안쓰임, 실버라이트로 씀)
[MainWindow.xaml]
<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>
[MainWindow.xaml.cs]
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);
}
}
}
'.NET프로그래밍 > WPF' 카테고리의 다른 글
(WPF로 만든) 주소록 프로그램 - WpfAddressBook (0) | 2010.01.05 |
---|---|
WPF(Windows Presentation Foundation) 추천 사이트 (0) | 2010.01.05 |