积极答复者
初学,请教各位老大画线问题

问题
答案
-
-
你参照下这里,这是个棋盘的画法
http://www.cnblogs.com/johnsneakers/archive/2011/05/07/2039688.html
http://blog.csdn.net/zx13525079024- 已标记为答案 Lie YouModerator 2011年10月17日 2:16
-
还一种方法:
Visual Studio 中toolBox中,有一个标签叫Visual Basic PowerPacks,里面有举行和线条,可以拖拽来实现那张图。
先拖拽一个矩形,调整到适合的大小,然后拖2条线,画成下面的形状
然后全选,复制,粘贴,先放一行,如图:
然后在全选,复制,粘贴,调整位置就行了。
代码如下:
this.shapeContainer1 = new Microsoft.VisualBasic.PowerPacks.ShapeContainer(); this.lineShape2 = new Microsoft.VisualBasic.PowerPacks.LineShape(); this.lineShape1 = new Microsoft.VisualBasic.PowerPacks.LineShape(); this.rectangleShape1 = new Microsoft.VisualBasic.PowerPacks.RectangleShape(); this.SuspendLayout(); // // shapeContainer1 // this.shapeContainer1.Location = new System.Drawing.Point(0, 0); this.shapeContainer1.Margin = new System.Windows.Forms.Padding(0); this.shapeContainer1.Name = "shapeContainer1"; this.shapeContainer1.Shapes.AddRange(new Microsoft.VisualBasic.PowerPacks.Shape[] { this.lineShape2, this.lineShape1, this.rectangleShape1}); this.shapeContainer1.Size = new System.Drawing.Size(635, 400); this.shapeContainer1.TabIndex = 0; this.shapeContainer1.TabStop = false; // // lineShape2 // this.lineShape2.Name = "lineShape2"; this.lineShape2.X1 = 69; this.lineShape2.X2 = 22; this.lineShape2.Y1 = 14; this.lineShape2.Y2 = 63; // // lineShape1 // this.lineShape1.Name = "lineShape1"; this.lineShape1.X1 = 24; this.lineShape1.X2 = 70; this.lineShape1.Y1 = 16; this.lineShape1.Y2 = 64; // // rectangleShape1 // this.rectangleShape1.Location = new System.Drawing.Point(22, 15); this.rectangleShape1.Name = "rectangleShape1"; this.rectangleShape1.Size = new System.Drawing.Size(48, 49);
希望对您有所帮助。
Best Regards,
Rocky Yue[MSFT]
MSDN Community Support | Feedback to us
Get or Request Code Sample from Microsoft
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
- 已编辑 Lie YouModerator 2011年10月12日 9:35 每次只能发2张图片,最后的效果图就跟你的差不多了,就不上传了。
- 已标记为答案 Lie YouModerator 2011年10月17日 2:16
全部回复
-
-
你参照下这里,这是个棋盘的画法
http://www.cnblogs.com/johnsneakers/archive/2011/05/07/2039688.html
http://blog.csdn.net/zx13525079024- 已标记为答案 Lie YouModerator 2011年10月17日 2:16
-
还一种方法:
Visual Studio 中toolBox中,有一个标签叫Visual Basic PowerPacks,里面有举行和线条,可以拖拽来实现那张图。
先拖拽一个矩形,调整到适合的大小,然后拖2条线,画成下面的形状
然后全选,复制,粘贴,先放一行,如图:
然后在全选,复制,粘贴,调整位置就行了。
代码如下:
this.shapeContainer1 = new Microsoft.VisualBasic.PowerPacks.ShapeContainer(); this.lineShape2 = new Microsoft.VisualBasic.PowerPacks.LineShape(); this.lineShape1 = new Microsoft.VisualBasic.PowerPacks.LineShape(); this.rectangleShape1 = new Microsoft.VisualBasic.PowerPacks.RectangleShape(); this.SuspendLayout(); // // shapeContainer1 // this.shapeContainer1.Location = new System.Drawing.Point(0, 0); this.shapeContainer1.Margin = new System.Windows.Forms.Padding(0); this.shapeContainer1.Name = "shapeContainer1"; this.shapeContainer1.Shapes.AddRange(new Microsoft.VisualBasic.PowerPacks.Shape[] { this.lineShape2, this.lineShape1, this.rectangleShape1}); this.shapeContainer1.Size = new System.Drawing.Size(635, 400); this.shapeContainer1.TabIndex = 0; this.shapeContainer1.TabStop = false; // // lineShape2 // this.lineShape2.Name = "lineShape2"; this.lineShape2.X1 = 69; this.lineShape2.X2 = 22; this.lineShape2.Y1 = 14; this.lineShape2.Y2 = 63; // // lineShape1 // this.lineShape1.Name = "lineShape1"; this.lineShape1.X1 = 24; this.lineShape1.X2 = 70; this.lineShape1.Y1 = 16; this.lineShape1.Y2 = 64; // // rectangleShape1 // this.rectangleShape1.Location = new System.Drawing.Point(22, 15); this.rectangleShape1.Name = "rectangleShape1"; this.rectangleShape1.Size = new System.Drawing.Size(48, 49);
希望对您有所帮助。
Best Regards,
Rocky Yue[MSFT]
MSDN Community Support | Feedback to us
Get or Request Code Sample from Microsoft
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
- 已编辑 Lie YouModerator 2011年10月12日 9:35 每次只能发2张图片,最后的效果图就跟你的差不多了,就不上传了。
- 已标记为答案 Lie YouModerator 2011年10月17日 2:16