Friday, April 27, 2012

Create Metro style Hello World in C++ using Microsoft Visual Studio 11 Express for Windows 8 Beta

- New a Project in Microsoft Visual Studio 11 Express for Windows 8 Beta, using template of Visual C++, Windows Metro style, Blank Application, name it helloMetroC.

- The wizard will generate a dummy application for you.

- Double click on the BlankPage.xaml from the Solution Explorer, to start edit it.

- Click TOOLBOX on the left side border, to expend the Toolbox panel. Click to expend Common XAML Controls, drag a TextBlock on the Design Pane.

- Now, you can see a TextBlock in the design view, and a new element of <TextBlock> in XAML view.


- We can edit the XAML directly.
Modify the content of <TextBlock> element like it:
    <Grid Background="{StaticResource ApplicationPageBackgroundBrush}">
        <TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="50" Text="Hello Metro" />

    </Grid>


- Select Save All from File menu, to save the solution.

- To build the solution, Build Solution from Build menu (or press F7).

- Run it by clicking on the Play button, or Start Debugging from Debug menu, or press F5 directly.


Next:
- Hello Metro application using C++, with Button click event handler.

No comments:

Post a Comment