我支持e_zhima(深绿色的树) 的观点。 Dim WithEvents PicParam As PictureBox 这样就搞定了。试试吧
用对象浏览器找到picturebox的类 dim p withevent as 你找到你类 set a = new p ("名称")
错了,错了,刚才写错了dim withevent p as 你找到你类 set a = new p ("名称")
Dim WithEvents Pic As PictureBoxPrivate Sub Form_Load() Set Pic = Controls.Add("vb.picturebox", "pic") Pic.Move 0, 0, 4500 Pic.Visible = True End SubPrivate Sub Pic_Paint() Pic.Print "这是动态添加的" End Sub
Dim WithEvents PicParam As PictureBox
这样就搞定了。试试吧
dim p withevent as 你找到你类
set a = new p ("名称")
set a = new p ("名称")
Set Pic = Controls.Add("vb.picturebox", "pic")
Pic.Move 0, 0, 4500
Pic.Visible = True
End SubPrivate Sub Pic_Paint()
Pic.Print "这是动态添加的"
End Sub