看板 Visual_Basic 關於我們 聯絡資訊
請教各位大大... 小弟想要做一個頁籤功能可以顯示同一個DataTable欄位資料 而頁籤的功能類似於第一頁,第二頁... 想使用第一頁的DataGridView而其他頁也使用此Table只是內含值不同 要怎麼弄才好呢? thx 第一段頁籤的程式碼 '第一個欄位 Dim IO_Address1 As DataColumn = IO_Table1.Columns.Add("Address", System.Type.GetType("System.String")) IO_Address1.ReadOnly = True '第二個欄位 Dim IO_Content1 As DataColumn = IO_Table1.Columns.Add("Content", System.Type.GetType("System.String")) IO_Content1.ReadOnly = True '第三個欄位為顯示狀態 Dim IO_Status1 As DataColumn = IO_Table1.Columns.Add("Status", System.Type.GetType("System.Int32")) '將文字檔資訊讀入Table中 Using myReader As New TextFieldParser("INI\DIO_Table.ini", System.Text.Encoding.Default) myReader.TextFieldType = FieldType.Delimited myReader.Delimiters = New String() {","} Dim currentRow As String() Dim myRowCount As Integer = 0 While Not myReader.EndOfData Try currentRow = myReader.ReadFields() If myRowCount >= _IO_POINT_ Then IO_Table2.Rows.Add(currentRow) Else IO_Table1.Rows.Add(currentRow) End If Catch ex As MalformedLineException MessageBox.Show(ex.Message) End Try myRowCount += 1 End While End Using IO_View1.DataSource = IO_Table1 -- -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 210.66.243.5