* Reset branch for WPF changes * Convert BMP to PNG; fix link-out-of-scope err * Add snippets for WPF... 6794 files!!!! * Add missing snippets * update file updated between migration * Fix paths to include * update breadcrumb and toc * fix index links * fix index links * fix index links * fix markdown
1.9 KiB
title, ms.date, dev_langs, helpviewer_keywords, ms.assetid
| title | ms.date | dev_langs | helpviewer_keywords | ms.assetid | |||||
|---|---|---|---|---|---|---|---|---|---|
| How to: Use the Attached Properties of Canvas to Position Child Elements | 03/30/2017 |
|
|
48f1d25d-3820-4107-a4cc-d6c1e5664a44 |
How to: Use the Attached Properties of Canvas to Position Child Elements
This example shows how to use the attached properties of xref:System.Windows.Controls.Canvas to position child elements.
Example
The following example adds four xref:System.Windows.Controls.Button elements as child elements of a parent xref:System.Windows.Controls.Canvas. Each element is represented by a xref:System.Windows.Controls.Canvas.Bottom%2A, xref:System.Windows.Controls.Canvas.Left%2A, xref:System.Windows.Controls.Canvas.Right%2A, and xref:System.Windows.Controls.Canvas.Top%2A. Each xref:System.Windows.Controls.Button is positioned relative to the parent xref:System.Windows.Controls.Canvas and according to its assigned property value.
[!code-cppCanvasAttachedProperties#1] [!code-csharpCanvasAttachedProperties#1] [!code-vbCanvasAttachedProperties#1]
See also
- xref:System.Windows.Controls.Canvas
- xref:System.Windows.Controls.Canvas.Bottom%2A
- xref:System.Windows.Controls.Canvas.Left%2A
- xref:System.Windows.Controls.Canvas.Right%2A
- xref:System.Windows.Controls.Canvas.Top%2A
- xref:System.Windows.Controls.Button
- Panels Overview
- How-to Topics
- Attached Properties Overview