3月 29, 2010

動態調用控制項



        Dim newTextbox As TextBox
        Dim i As Integer
        For i = 1 To 9
            newTextbox = New TextBox
            newTextbox.ID = "TextBox" & i.ToString
            Me.Panel1.Controls.Add(newTextbox)
            Me.Panel1.Controls.Add(New LiteralControl("<br>"))
            newTextbox.Text = "TextBox" & i.ToString
        Next

沒有留言: