[.NET] 該怎麼動態新增欄位阿??

看板Visual_Basic作者 (abcde)時間18年前 (2007/10/30 20:18), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/2 (看更多)
小弟是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
文章代碼(AID): #179o3-EH (Visual_Basic)
文章代碼(AID): #179o3-EH (Visual_Basic)