Create and Use a Canvas

How to: Create and Use a Canvas

 

This example shows how to create and use an instance of Canvas.

Example

The following example explicitly positions two TextBlock elements by using the SetTop and SetLeft methods of Canvas. The example also assigns a Background color of LightSteelBlue to the Canvas.

System_CAPS_noteNote

When you use Extensible Application Markup Language (XAML) to position TextBlock elements, use the Top and Left properties.

Show:
© 2016 Microsoft