This is what I found on a website on how to do this:
*****************************************
Getting and Setting Active Tab Programmaticall
You can get and set an active tab of a TabControl programmatically using the
SelectedTab property of TabControl. For example, the following code snippet
sets PreferencePage as active tab:
this.tabControl1.SelectedTab = this.PreferencesPage;
*********************************************
I tried this:
EmailDataGrid.TableStyles.Add(dgStyle)
EmailDataGrid.DataSource = ds.Tables("Emails")
EmailDataGrid.ReadOnly = True
TabControl1.SelectedTab = TabPage1
But it doesn't do anything. I am doing this. After filling the DataGrid, I
am setting the TabContol1 to the TabPage1 page.
Is there something else I need to do to get this to work?
Thanks,
Tom
"tshad" <tf*@dslextreme.comwrote in message
news:%2****************@TK2MSFTNGP02.phx.gbl...
>I forgot to mention that this is a VS 2003 Windows Forms DataGrid.
Tom
"tshad" <tf*@dslextreme.comwrote in message
news:u%****************@TK2MSFTNGP06.phx.gbl...
>>I have a page with 2 Tabbed Pages on them (TabPage1, TabPage2).
I am on TabPage1 and when selecting something on the page I am displaying
information on TabPage2 and then want to go to TabPage2, but it doesn't
work.
I tried:
EmailFrom.Text = ds.Tables("Emails").Rows(row)("from_address")
EmailTo.Text = ds.Tables("Emails").Rows(row)("to_addresses")
CC.Text = ds.Tables("Emails").Rows(row)("cc_addresses")
BCC.Text = ds.Tables("Emails").Rows(row)("bcc_addresses")
Subject.Text = ds.Tables("Emails").Rows(row)("subject")
Body.Text = ds.Tables("Emails").Rows(row)("body")
TabPage1.SendToBack()
and also TabPage1.Visible = False but neither worked.
How do I get TabPage2 to display programmatically?
It works fine if I select the tab manually but I want it to automatically
display the tabbed page after the data is put on the page.
Thanks,
Tom