In Visual Studio 2008 OR any
- 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"
- Visual Studio creates the project and automatically adds some files to the solution. A Window1.xaml and an App.xaml. The structure looks quite similar to WinForms, except that the
Window1.designer.cs
file is no longer code but it's now declared in XAML asWindow1.xaml
- Select the Button and switch to the event view in the properties window (click on the little yellow lightning icon). Doubleclick on the "Click" event to create a method in the codebehind that is called, when the user clicks on the button.
Note: 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.
- Visual Studio automatically creates a method in the code-behind file that gets called when the button is clicked.
private void button1_Click(object sender, RoutedEventArgs e)
{
textBox1.Text = "Hello WPF!";
}
- The textbox has automatically become assigned the name
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.
Thanks for the info. .net Training in velachery
ReplyDeleteThanks for sharing nice article.
ReplyDeleteif you want to know the technologies updates,visit below site.
Dot Net Tutorial for Beginners with Examples
Thanks for sharing this Information it was nice to read thisDot Net Training in Irving
ReplyDeletehello sir, your article is very good.thanks for sharing useful information about your blog. visit us at
ReplyDeleteDot Net Training in Austin
Hi, Thanks for share a nice information of the blog. FOr more information please visit.
ReplyDeleteDOT NET Training Institutes in Ameerpet
Hi...thanks for nice information.
ReplyDeletelove calculator program in c
Really nice blog post.provided a helpful information.I hope that you will post more updates
ReplyDeletelike this
.NET Online Course
"very nice and amazing blog you have written i have read all this blog many things mentioned in this blog please keep updating the blog and posting because Dot net is a very easy and simple language. it is easy to understand and use and also support multiple languages.
ReplyDeleteDot Net training in Chandigarh
Data Science training Chandigarh
Big data training Mohali"
This comment has been removed by the author.
ReplyDeletewatch full course @ C#
ReplyDeleteGood Post. I like your blog. Thanks for Sharing
ReplyDelete.Net Training Institute In Noida
This comment has been removed by the author.
ReplyDelete