请教:每点击窗体一次,窗体上增加一张同样的图片,用vb怎么写?谢谢。
1个回答
展开全部
用控件数组,在属性窗口将picture1的index属性设为0:
Private Sub form_click()
i = Picture1.Count
Load Picture1(i)
Picture1(i).Visible = True
If i Mod 4 > 0 Then
Picture1(i).Top = Picture1(i - 1).Top
Picture1(i).Left = Picture1(i - 1).Left + Picture1(i - 1).Width + 300
Else
Picture1(i).Top = Picture1(i - 1).Top + Picture1(i - 1).Height + 300
Picture1(i).Left = Picture1(0).Left
End If
End Sub
Private Sub form_click()
i = Picture1.Count
Load Picture1(i)
Picture1(i).Visible = True
If i Mod 4 > 0 Then
Picture1(i).Top = Picture1(i - 1).Top
Picture1(i).Left = Picture1(i - 1).Left + Picture1(i - 1).Width + 300
Else
Picture1(i).Top = Picture1(i - 1).Top + Picture1(i - 1).Height + 300
Picture1(i).Left = Picture1(0).Left
End If
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询