C# WPF Tutorial : Create First WPF Desktop Application

C# WPF Tutorial for beginner : how to create simple application WPF Desktop Application Windows Presentation Foundation using C# programming language

C# WPF Tutorial - create simple application using WPF (Windows Presentation Foundation) in C# programming language, In addition to vb.net, C# also can handle WPF (Windows Presentation Foundation) to create beauty Desktop applications.

Please Read :
  1. VB.NET WPF Tutorial : Make WPF Desktop Application 
  2. C# Simple CRUD operations using MySQL Database

XAML (Extensible Application Markup Language)

WPF uses XAML to represent the UI and user interaction. XAML is constructed from XML and writing similar to XHTML frequently you use in creating web-based applications. XAML also supports the principles of the code-behind as in the application ASP.NET. By using XAML, designers and programmers can work together in developing applications, first create the UI design designer then programmer continue by adding the code in a language that is supported by such C #/.NET and VB.NET.

Create C# WPF Application

Open your visual studio and please create New WPF application. Click File menu > New Project.

C# WPF Tutorial
Click on Visual C# -> Select Windows -> Verify target framework version -> Select WPF Application -> Specify project Name, Location -> Click on OK.

C# WPF Tutorial
Change window title either from Properties window or XAML Editor. You can see a reflection in Designer view. There are lots of properties available to change design of the window according to our requirements.

C# WPF Tutorial
Click on Toolbox, Several controls are available in toolbox like Button, CheckBox, ComboBox, etc. You can simply design your surface by Click and drag a control from the Toolbox to the design surface. Click and drag Button control to the design surface.

Source Code C# WPF Application

Double Click On the Button1 and write this source code

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
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 C_WPFapplication {
    /// Interaction logic for MainWindow.xaml
    public partial class MainWindow : Window {
        public MainWindow() {

        private void button_Click(object sender, RoutedEventArgs e) {
            MessageBox.Show("Hello World!", "www.hc-kr.com");

Now Run the application by clicking on Start Debugging (F5) button.


Feel free to code it up and send us a pull request.

Hi everyone, let's me know how much this lesson can help your work. Please Subscribe and Follow Our Social Media 'kodeajaib[dot]com' to get Latest tutorials and will be send to your email everyday for free!, Just hit a comment if you have confused. Nice to meet you and Happy coding :) all ^^

Follow by E-Mail


ADO.NET,3,Ajax,6,Android,9,AngularJS,4,ASP.NET,4,Blogger Tutorials,7,Bootstrap,7,C++,1,Codeigniter,2,Cplusplus,6,Crystal Report,6,CSharp,25,Ebook Java,2,FlyExam,1,FSharp,3,Game Development,2,Java,35,JDBC,2,Laravel,84,Lumen,2,MariaDB,2,Ms Access,3,MySQL,31,ODBC,6,OleDB,1,PHP,14,PHP Framework,5,PHP MYSQLI,9,PHP OOP,5,Python,8,Python 3,4,SQL Server,4,SQLite,4,Uncategorized,5,Vb 6,2,Vb.Net,89,Video,48,Vue Js,4,WPF,2,Yii,3,
KODE AJAIB: C# WPF Tutorial : Create First WPF Desktop Application
C# WPF Tutorial : Create First WPF Desktop Application
C# WPF Tutorial for beginner : how to create simple application WPF Desktop Application Windows Presentation Foundation using C# programming language
Loaded All Posts Not found any posts VIEW ALL Readmore Reply Cancel reply Delete By Home PAGES POSTS View All RECOMMENDED FOR YOU LABEL ARCHIVE SEARCH ALL POSTS Not found any post match with your request Back Home Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sun Mon Tue Wed Thu Fri Sat January February March April May June July August September October November December Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec just now 1 minute ago $$1$$ minutes ago 1 hour ago $$1$$ hours ago Yesterday $$1$$ days ago $$1$$ weeks ago more than 5 weeks ago Followers Follow THIS CONTENT IS PREMIUM Please share to unlock Copy All Code Select All Code All codes were copied to your clipboard Can not copy the codes / texts, please press [CTRL]+[C] (or CMD+C with Mac) to copy