VB-執行中新增一個picturebox

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高手!
2015-02-12 22:23 發佈
文章關鍵字 vb- picturebox
大概是這樣做
就是建立一個新物件,把屬性複製過去

最重要的是要在原本的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
ok,好啦,謝啦!
abollar wrote:
Private Su...(恕刪)
內文搜尋
X
評分
評分
複製連結
Mobile01提醒您
您目前瀏覽的是行動版網頁
是否切換到電腦版網頁呢?