Create a simple WPF Application

In this article you will learn how to create a simple WPF application.
  • 541
Download Files:
 

To create a simple WPF application you need to follow these simple steps which given below's:

  1. Open visual studio and go to File menu click on New and select Project.
     

  2. Choose WPF Application under Visual Studio Templates and given the name to WPF Application and click on Ok.

    wapp1.gif 

  3. Go to the Solution Explorer and open MainWindow.xaml "by double click on it".
      
    wapp2.gif 

  4. Now drag one Button and one TextBox on WPF designer pane.

    wapp3.gif 

  5. Go to the Properties window and set the Content Property of the Button as OK.

    wapp4.gif 

  6. Now double click on the Button and write down this code. 

    Class MainWindow 
        Private Sub Button1_Click(ByVal sender As System.Object,ByVal e AsSystem.Windows.RoutedEventArgs)Handles Button1.Click
            TextBox1.Text = 
    "HELLO STUDENTS"
        End Sub
    End
     Class
     

  7. Now run the application by pressing F5, and on output window when you click on "OK" the message will shows in TextBox.

    wapp5.gif 

Conclusion

Hope this article helps you when you create an simple WPF application.

Categories

More Articles

© 2013 dotNetheaven. All rights reserved.