Dim PictureBox11(1) as PictureBox ‘放在最前面
创新互联公司服务项目包括威信网站建设、威信网站制作、威信网页制作以及威信网络营销策划等。多年来,我们专注于互联网行业,利用自身积累的技术优势、行业经验、深度合作伙伴关系等,向广大中小型企业、政府机构等提供互联网行业的解决方案,威信网站推广取得了明显的社会效益与经济效益。目前,我们服务的客户以成都为中心已经辐射到威信省份的部分城市,未来相信会继续扩大服务区域并继续获得客户的支持与信任!
Dim i as integer
Form_load 设i=0
动态添加:
if ipicturebox11.ubound then load(picturebox11(i))
picturebox11(i).loadpicture("图片地址")
Picture11(i).PaintPicture Picture11(i).Picture, 0, 0, Picture11(i).Width, Picture11(i).Height
picturebox11(i).visible=true
i=i+1
动态删除
i=i-1
unload picturebox11(i)
Imports System.Drawing
Imports System.Drawing.Drawing2D
Public Class Form1
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim g As Graphics = PictureBox1.CreateGraphics
Dim hs As HatchStyle = HatchStyle.Cross
Dim sb As HatchBrush = New HatchBrush(hs, Color.Black, Color.White)
Dim p(3) As Point
p(0).X = 100
p(0).Y = 50
p(1).X = 0
p(1).Y = 100
p(2).X = 200
p(2).Y = 100
p(3).X = 100
p(3).Y = 50
g.FillPolygon(sb, p)
g.DrawPolygon(Pens.Black, p)
End Sub
End Class
VB点虐 与VB不同。
VB点虐 已经有专门绘图的类。
可以定义笔刷然后用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
.NET 的第三方控件首推Devexpress
不过这个控件学起来有些难度,官方文档全是英文的;而且国内资料较少