在WPF中子元素的绝对定位的布局控件
例如:
1: <Canvas>
2: <Button Canvas.Left="10" Canvas.Top="10" Height="23" Width="75">LTButton>
3: <Button Canvas.Right="10" Canvas.Top="10" Height="23" Width="75">RTButton>
4: <Button Canvas.Left="10" Canvas.Bottom="10" Height="23" Width="75">LBButton>
5: <Button Canvas.Right="10" Canvas.Bottom="10" Height="23" Width="75">RBButton>
6: Canvas>
在调整窗体大小时,LT与左、上距离保持不变;RT与右、上距离保持不变;LB与左、下距离保持不变;RB与右、下距离保持不变。使用Canvas不能简单地实现Windows应用程序中Acho的功能。
在WPF中实现允许使用墨迹的控件。如:
1: <Window x:Class="WPFLayoutDemo.InkCanvasDemo"
2: xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3: xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4: Title="InkCanvasDemo" Height="200" Width="300">
5: <InkCanvas>
6: <InkCanvas.DefaultDrawingAttributes>
7: <DrawingAttributes Color="Red" />
8: InkCanvas.DefaultDrawingAttributes>
9: <Image Width="155" Height="155" InkCanvas.Left="10" InkCanvas.Top="10"
10: Source="Logo2.png"/>
11: InkCanvas>
12: Window>
其他的功能与Canvas相近。
原文:http://www.cnblogs.com/DragonInSea/archive/2009/04/10/1433210.html
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/12639172/viewspace-604312/ ,如需转载,请注明出处,否则将追究法律责任。