编程论坛's Archiver

wtnu200 发表于 2008-5-6 22:28

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

我想做个程序,就是运行时,有个button1,然后每按一次就增加一个label.(位置等可以先忽备)我不知道代码怎么写,请各位大虾帮下我这个小虾米.谢了

bwch_xm 发表于 2008-5-8 11:16

Dim label1 As New Label
        label1.Visible = True

wtnu200 发表于 2008-5-8 12:52

楼上的这样好像不太对吧.

c476169962 发表于 2008-6-7 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]

Powered by Discuz! Archiver 6.1.0  © 2001-2007 Comsenz Inc.