Sunday, December 14, 2014

1023 - Visual Studio 2012 C# - Create WPF Application


---
1023 - Visual Studio 2012 C# - Create Windows Presentation Foundation (WPF) Application
1) Create a new WPF Project
2) Display Toolbox
3) Add Control Object
4) Edit Codes
5) Save the application
6) Run the application

1) Create a new WPF Project

1.1) Go to Menu. Select File/New/Project…
1.2) Enter project settings.
Visual C#
Windows
.Net 4.5
WPF Application
WpfApplication1
Wait…
1.3) Outcome.

2) Display Toolbox

2.1) Click the Toolbox tab and then click the Pin button.
2.2) Outcome.
(Toolbox panel is pinned to the window).

3) Add Control Object

3.1) Click the Button control in the Toolbox to select it.
3.2) Double-click the Button control to place the object on the form.

4) Edit Codes

4.1) Double-click the Button object on the form.
4.2) Outcome.
(The code window is displayed).
4.3) Type the following code in the red rectangle shown in the above picture.
MessageBox.Show("My first WPF Application!");

5) Save the application

6) Run the application

6.1) Click the Start button (with Debug option).
Wait…
6.2) Outcome.
6.3) Click the button.
---

No comments:

Post a Comment