Dim Frm As New TabFormPage Dim MoreTabs As TabPage = Frm.TabPage1 Dim i As Integer For i = 1 To TabControl1.TabPages.Count MoreTabs.Text = "TabPage" & i + 1 Next i TabControl1.Controls.Add(MoreTabs) Frm.Dispose()
Private Sub BackgroundWorker1_DoWork(sender As Object, e As System.ComponentModel.DoWorkEventArgs) Handles BackgroundWorker1.DoWork MyConnection = New System.Data.OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + FPathTab + ";Extended Properties=Excel 12.0;") MyCommand = New System.Data.OleDb.OleDbDataAdapter("select * from [" & CSheetTab1 & "]'", MyConnection) DtSet = New System.Data.DataSet DtSet.Clear() MyCommand.Fill(DtSet) End Sub Private Sub BackgroundWorker1_RunWorkerCompleted(sender As Object, e As System.ComponentModel.RunWorkerCompletedEventArgs) Handles BackgroundWorker1.RunWorkerCompleted DataGridView1.DataSource = DtSet.Tables(0) dv = DtSet.Tables(0).DefaultView MaxRecords = DtSet.Tables(0).Rows.Count MyConnection.Close() DataGridView1.Columns("F20").Visible = False DataGridView1.Columns("F21").Visible = False DataGridView1.Columns("F22").Visible = False End Sub
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)