In Visual Studio 2008
Open Visual Studio 2008 and choose "File", "New", "Project..." in the main menu. Choose "WPF Application" as project type.Choose a folder for your project and give it a name. Then press "OK"
Window1.designer.cs
file is no longer code but it's now declared in XAML as Window1.xaml
Window1.xaml
file in the WPF designer and drag a Button and a TextBox from the toolbox to the WindowNote: If you do not find a yellow lightning icon, you need to install the Service Pack 1 for VisualStudio on your machine. Alternatively you can doubleclick on the button in the designer to achieve the same result.
private void button1_Click(object sender, RoutedEventArgs e) { textBox1.Text = "Hello WPF!"; }
textBox1
by the WPF designer. Set text Text to "Hello WPF!" when the button gets
clicked and we are done! Start the application by hit [F5] on your
keyboard.
Comments
Post a Comment