How can I create a dotted design surface like VB6 forms?
What control do can I use to simulate VB6's dotted design surface?
I want to create room maps and I want the user to be able to align the items while开发者_运维技巧 dragging.
Here's how to make the dots every ten pixels using a DrawingBrush
:
<Grid>
<Rectangle>
<Rectangle.Fill>
<DrawingBrush Viewport="0,0,10,10" ViewportUnits="Absolute" TileMode="Tile">
<DrawingBrush.Drawing>
<DrawingGroup>
<GeometryDrawing Brush="Transparent">
<GeometryDrawing.Geometry>
<RectangleGeometry Rect="0,0,10,10"/>
</GeometryDrawing.Geometry>
</GeometryDrawing>
<GeometryDrawing Brush="Black">
<GeometryDrawing.Geometry>
<RectangleGeometry Rect="0,0,1,1"/>
</GeometryDrawing.Geometry>
</GeometryDrawing>
</DrawingGroup>
</DrawingBrush.Drawing>
</DrawingBrush>
</Rectangle.Fill>
</Rectangle>
</Grid>
actually I believe the easiest way to do it would be to use an array, such as is mentioned here: http://social.msdn.microsoft.com/Forums/is/Vsexpressvb/thread/5626ef50-c2df-4e59-a8e9-3ae6eaa98ce9
and just make the background of your form a plain grey box, with darker dots that align to the points in the array
精彩评论