一、Canvas (更多资源:http://cleopard.download.csdn.net/)
在 WPF 中子元素的绝对定位的布局控件
其子元素使用 Width、Height 定义元素的宽度和高度
使用
Convas.Left(Convas.Right)、Convas.Top(Convas.Bot
tom)定义与 Convas 容器的相对位置
如果同时存在 Convas.Left 和
Convas.Right、Convas.Top 和 Convas.Bottom,则
Convas.Left、Convas.Top 优先生效
例如:
1: <Canvas>
2: <Button Canvas.Left="10" Canvas.Top="10"
Height="23" Width="75">LT</Button>
3: <Button Canvas.Right="10" Canvas.Top="10"
Height="23" Width="75">RT</Button>
4: <Button Canvas.Left="10" Canvas.Bottom="10"
Height="23" Width="75">LB</Button>
5: <Button Canvas.Right="10" Canvas.Bottom="10"
Height="23" Width="75">RB</Button>
6: </Canvas>
在调整窗体大小时,LT 与左、上距离保持不变;RT 与右、上距离保持不变;
LB 与左、下距离保持不变;RB 与右、下距离保持不变。使用 Canvas 不能简
单地实现 Windows 应用程序中 Acho 的功能。
二、InkCanvas (更多资源:http://cleopard.download.csdn.net/)
在 WPF 中实现允许使用墨迹的控件。如:
1: <Window x:Class="WPFLayoutDemo.InkCanvasDemo"
2:
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/prese
ntation"
评论27