The Canvas Panel
Most WPF containers allow the dynamic rearrangement of controls within the user interface. This is useful when you want your user to adjust interface settings, but it can complicate things when you need to place controls in a fixed, unchangeable place (as basically happens in Windows Forms). To accomplish this you use the Canvas container, which allows absolute placement, meaning that it allows specifying the position of nested controls. When you place controls into a Canvas container, you specify the absolute position with some attached properties: Canvas.Left, Canvas.Top, Canvas.Right, and Canvas.Bottom. The following code shows how you place a button that never changes its position in the user interface, thanks to the Canvas.Left ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access