#194 – Hello WPF World, Love Blend

Let’s create a simple application using Blend.  We’ll just have a single button in a window, which will display a message when you click it.

Use Blend to create a new WPF Application project.

Find a Button on the Assets tab.

Drag it onto your main window.

Left-click to select the button.  Change its Content property to “Hello”.

The button’s content will update in the designer.

Left-click to select the button.  Click on the Events icon in the Properties panel.

Dbl-click in the text area to the right of the Click event.  A Button_Click event handler will be created and you’ll be taken to the code editor.

Erase the “TODO” comment line and add the following line:

    MessageBox.Show("I'm a Blend convert!", "About Me");

Press Ctrl-F5 to run the project.  You’ll see your main window.

Click on the Hello button to see your message.

Advertisement