[.NET] 該怎麼動態新增欄位阿??
小弟是VB新手..看到一個範例突然有個問題想請教各位高手...
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
Me.Table1.GridLines = GridLines.Both
Dim newstring() As String
newstring = Me.TextBox3.Text.Split(" ")
Me.TextBox3.Text = ""
Dim length As Integer = newstring.Length
Dim row As New TableRow()
For i As Integer = 0 To length - 1
Dim cell As New TableCell()
cell.Text = newstring(i)
row.Cells.Add(cell)
Next
Me.Table1.Rows.Add(row)
這段程式碼是說輸入字串用空白間隔
按下按鈕之後會新增一列表格----> 1 2 3
如果我再按 4 5 6 會蓋掉 1 2 3 變 4 5 6
請問要如何一直讓他新增呢?變成 1 2 3
4 5 6
7 8 9
是利用雙回圈嗎???
可以請大大們給我點提示嗎?
謝謝各位.....
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 203.70.162.83
討論串 (同標題文章)