Canvas
Canvas provides absolute positioning to its
contained controls. Canvas provides four properties to contained controls.
Those are Canvas.Top, Canvas.Bottom, Canvas.Left and Canvas.Right.
<Canvas Background="LightBlue">
<TextBlock Canvas.Top="30"
Canvas.Left="70">My first control</TextBlock>
<TextBlock Canvas.Top="60"
Canvas.Left="200">Other TextBlock control</TextBlock>
<TextBox>Default location</TextBox>
<TextBox Canvas.Top="140"
Canvas.Left="100">Other textbox location</TextBox>
</Canvas>
In above canvas example, added 4 controls and for few
controls assigned attached property of canvas. If you not assigned attached
property to contained controls, its default position is (0,0). i.e. Top and
Left property value is 0.
No comments:
Post a Comment