vb.net自绘 vb绘图教程

vb.net控件的BorderStyle设置为FixedSingle会出现黑线边框,可以更改他的颜色吗 比如改成红色线边框

要么重写这个控件的 OnPaint 事件,判断 BorderStyle 属性为 FixedSingle 的时候自绘其他颜色。

成都创新互联是专业的新河网站建设公司,新河接单;提供成都做网站、成都网站建设,网页设计,网站设计,建网站,PHP网站建设等专业做网站服务;采用PHP框架,可快速的进行新河网站开发网页制作和功能扩展;专业做搜索引擎喜爱的网站,专业的做网站团队,希望更多企业前来合作!

要么不重写,把 BorderStyle 设为 None,直接在这个控件的 Paint 事件里自绘边框,例如:

Private Sub Label1_Paint(sender As Object, e As PaintEventArgs) Handles Label1.Paint

e.Graphics.DrawRectangle(Pens.Red, New Rectangle(Label1.DisplayRectangle.X, Label1.DisplayRectangle.Y, Label1.DisplayRectangle.Width - 1, Label1.DisplayRectangle.Height - 1))

End Sub

运行效果:

怎么利用VB.NET实现三维绘图

数学上不是有斜二测画法,算好坐标即可画出

或者用AnyCAD的.Net图形控件

也可以调用matlab 实现

VB.net中如何画图?

VB.net与VB不同。

VB.net已经有专门绘图的类。

可以定义笔刷然后用Drawing类中的方法绘制。

Private Sub DrawEllipse()

Dim myPen As New System.Drawing.Pen(System.Drawing.Color.Red)

Dim formGraphics as System.Drawing.Graphics

formGraphics = Me.CreateGraphics()

formGraphics.DrawEllipse(myPen, New Rectangle(0,0,200,300))

myPen.Dispose()

formGraphics.Dispose()

End Sub

Private Sub DrawRectangle()

Dim myPen As New System.Drawing.Pen(System.Drawing.Color.Red)

Dim formGraphics as System.Drawing.Graphics

formGraphics = Me.CreateGraphics()

formGraphics.DrawRectangle(myPen, New Rectangle(0,0,200,300))

myPen.Dispose()

formGraphics.Dispose()

End Sub


网页名称:vb.net自绘 vb绘图教程
URL链接:http://scyanting.com/article/hpesip.html