Private Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
程式碼
End Sub
也就是我按Button1,表單會新增一個picturebox
並命名為a1
而大小背景圖等同於picturebox1(相當於複製新增一個picturebox1)
下一次按Button1時,新增的picturebox命名為a2
求VB高手!
就是建立一個新物件,把屬性複製過去
最重要的是要在原本的Form安排位置,最快的方法就是放個FlowLayoutPanel,就會自動排了
Private PictureBoxCount As Integer = 0
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
PictureBoxCount += 1
Dim picBox As PictureBox
picBox = New PictureBox()
picBox.Name = "a" & PictureBoxCount
picBox.Width = PictureBox1.Width
picBox.Height = PictureBox1.Height
picBox.Image = PictureBox1.Image
FlowLayoutPanel1.Controls.Add(picBox)
End Sub
內文搜尋
X




























































































