How to: Create and Use a Canvas
.NET Framework (current version)
This example shows how to create and use an instance of Canvas.
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.
When you use Extensible Application Markup Language (XAML) to position TextBlock elements, use the Top and Left properties.