注册 登录
编程论坛 VB.NET论坛

每按一次button就有就增加的一label

wtnu200 发布于 2008-05-06 22:28, 1209 次点击
我想做个程序,就是运行时,有个button1,然后每按一次就增加一个label.(位置等可以先忽备)我不知道代码怎么写,请各位大虾帮下我这个小虾米.谢了
3 回复
#2
bwch_xm2008-05-08 11:16
Dim label1 As New Label
        label1.Visible = True
#3
wtnu2002008-05-08 12:52
楼上的这样好像不太对吧.
#4
2008-06-07 17:40
呵呵
Public Class Form1
    Dim i As Integer = 1
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim lablen As New Label
        lablen.Parent = Me
        lablen.BackColor = Color.Red
        Dim loc As Point
        loc.X = 120 + i
        loc.Y = 120 + i
        lablen.Location = loc
        lablen.Visible = True
        lablen.Show()
        i += 10
    End Sub
End Class
1