Contact me
   My PGP Key

Hello WPF

How to get this code going: Create a Windows Presentation Foundation project named HelloWPF and paste the following code in the specified file.

Paste this code into Window1.xaml:

<Window x:Class="HelloWPF.Window1"
    Title="Window1" Height="300" Width="300">
        <Button Height="23" Margin="96,50,107,0" Name="button1" VerticalAlignment="Top" Click="button1_Click">Say Hello!</Button>
        <Label Margin="84,115,74,119" Name="label1"></Label>

Paste this code into Window1.xaml.cs:

using System.Windows;

namespace HelloWPF
    public partial class Window1 : Window
        public Window1()

        private void button1_Click(object sender, RoutedEventArgs e)
            label1.Content = "Hello WPF!";

Compile and run.

Comment in the forum

Sitemap generated by Sitemap Manager