Search This Blog

Tuesday, October 22, 2013

Create a simple ‘Hello World’ WPF application

WPF > First application

Create a simple ‘Hello World’ WPF application

Go to menu File - > New Project and then Visual C# -> Windows -> WPF Application.

 
Visual studio automatically creates the project and adds some files: MainWindow.xaml and MainWindow.xaml.cs
Double click on MainWindow.xaml and from Toolbox window drag a button and a label. Name label “lblTtitle”.

 
Double click button and add the following code: lblTitle.Content = "Hello World!";

 
Press F5 to run the application