Canvas
Es el panel más simple, sencillo y flexible en el Presentation Framework. Este
tipo de panel posiciona cada elemento hijo en posiciones relativas con
coordenadas explícitas.
Para posicionar elementos dentro de un Canvas necesitamos las propiedades
Left y Top, Right y Bottom, Left y Bottom o Right y Top que posicionarán el
elemento con respecto al borde que corresponda del Canvas contenedor.
Además para establecer el orden de superposición de los elementos en el
Canvas existe la propiedad zIndex.
Si vemos un ejemplo, en el siguiente código XAML se muestra un Canvas
como Panel contenedor con seis controles de tipo TextBox colocados
utilizando las propiedades Left, Top, Right y Bottom.
<Window x:Class="WpfApplication1.Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="Window1"> <Canvas Name="mainCanvas" Background="Black"> <TextBox Text="Left=0 y Top=0"/> <TextBox Text="Left=15 y Top=15" Canvas.Left="15" Canvas.Top="15"/> <TextBox Text="Right=15 y Bottom=15" Canvas.Right="15" Canvas.Bottom="15"/> <TextBox Text="Right=0 y Bottom=0" Canvas.Right="0" Canvas.Bottom="0"/> <TextBox Text="Right=0 y Top=0" Canvas.Right="0" Canvas.Top="0"/> <TextBox Text="Left=0 y Bottom=0" Canvas.Left="0" Canvas.Bottom="0"/> </Canvas> </Window>
Y el resultado es el siguiente:
Genial post and this enter helped me alot in my college assignement. Say thank you you for your information.
Opulently I assent to but I contemplate the list inform should secure more info then it has.