Changing Tab Pages

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • tshad

    #1

    Changing Tab Pages

    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("Emai ls").Rows(row)( "from_addre ss")
    EmailTo.Text = ds.Tables("Emai ls").Rows(row)( "to_address es")
    CC.Text = ds.Tables("Emai ls").Rows(row)( "cc_address es")
    BCC.Text = ds.Tables("Emai ls").Rows(row)( "bcc_addresses" )
    Subject.Text = ds.Tables("Emai ls").Rows(row)( "subject")
    Body.Text = ds.Tables("Emai ls").Rows(row)( "body")
    TabPage1.SendTo Back()

    and also TabPage1.Visibl e = False but neither worked.

    How do I get TabPage2 to display programmaticall y?

    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


  • tshad

    #2
    Re: Changing Tab Pages

    I forgot to mention that this is a VS 2003 Windows Forms DataGrid.

    Tom
    "tshad" <tfs@dslextreme .comwrote in message
    news:u%23wHiIFI IHA.2064@TK2MSF TNGP06.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("Emai ls").Rows(row)( "from_addre ss")
    EmailTo.Text = ds.Tables("Emai ls").Rows(row)( "to_address es")
    CC.Text = ds.Tables("Emai ls").Rows(row)( "cc_address es")
    BCC.Text = ds.Tables("Emai ls").Rows(row)( "bcc_addresses" )
    Subject.Text = ds.Tables("Emai ls").Rows(row)( "subject")
    Body.Text = ds.Tables("Emai ls").Rows(row)( "body")
    TabPage1.SendTo Back()
    >
    and also TabPage1.Visibl e = False but neither worked.
    >
    How do I get TabPage2 to display programmaticall y?
    >
    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
    >

    Comment

    • tshad

      #3
      Re: Changing Tab Pages

      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 programmaticall y using the
      SelectedTab property of TabControl. For example, the following code snippet
      sets PreferencePage as active tab:

      this.tabControl 1.SelectedTab = this.Preference sPage;
      *************** *************** ***************

      I tried this:

      EmailDataGrid.T ableStyles.Add( dgStyle)
      EmailDataGrid.D ataSource = ds.Tables("Emai ls")
      EmailDataGrid.R eadOnly = True
      TabControl1.Sel ectedTab = 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" <tfs@dslextreme .comwrote in message
      news:%23fs5fNKI IHA.5544@TK2MSF TNGP02.phx.gbl. ..
      >I forgot to mention that this is a VS 2003 Windows Forms DataGrid.
      >
      Tom
      "tshad" <tfs@dslextreme .comwrote in message
      news:u%23wHiIFI IHA.2064@TK2MSF TNGP06.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.Te xt = ds.Tables("Emai ls").Rows(row)( "from_addre ss")
      >EmailTo.Text = ds.Tables("Emai ls").Rows(row)( "to_address es")
      >CC.Text = ds.Tables("Emai ls").Rows(row)( "cc_address es")
      >BCC.Text = ds.Tables("Emai ls").Rows(row)( "bcc_addresses" )
      >Subject.Text = ds.Tables("Emai ls").Rows(row)( "subject")
      >Body.Text = ds.Tables("Emai ls").Rows(row)( "body")
      >TabPage1.SendT oBack()
      >>
      >and also TabPage1.Visibl e = False but neither worked.
      >>
      >How do I get TabPage2 to display programmaticall y?
      >>
      >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
      >>
      >
      >

      Comment

      • tshad

        #4
        Re: Changing Tab Pages

        Got it to work.

        The problem had to do with it going to the SelectedIndexCh anged event of my
        ComboBox at the start of the program.

        Both TabControl1.Sel ectedTab and TabControl1.Sel ectedIndex worked fine.

        Tom
        "tshad" <tfs@dslextreme .comwrote in message
        news:%23Br8UvOI IHA.5684@TK2MSF TNGP06.phx.gbl. ..
        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 programmaticall y using
        the SelectedTab property of TabControl. For example, the following code
        snippet sets PreferencePage as active tab:
        >
        this.tabControl 1.SelectedTab = this.Preference sPage;
        *************** *************** ***************
        >
        I tried this:
        >
        EmailDataGrid.T ableStyles.Add( dgStyle)
        EmailDataGrid.D ataSource = ds.Tables("Emai ls")
        EmailDataGrid.R eadOnly = True
        TabControl1.Sel ectedTab = 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" <tfs@dslextreme .comwrote in message
        news:%23fs5fNKI IHA.5544@TK2MSF TNGP02.phx.gbl. ..
        >>I forgot to mention that this is a VS 2003 Windows Forms DataGrid.
        >>
        >Tom
        >"tshad" <tfs@dslextreme .comwrote in message
        >news:u%23wHiIF IIHA.2064@TK2MS FTNGP06.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.Tex t = ds.Tables("Emai ls").Rows(row)( "from_addre ss")
        >>EmailTo.Tex t = ds.Tables("Emai ls").Rows(row)( "to_address es")
        >>CC.Text = ds.Tables("Emai ls").Rows(row)( "cc_address es")
        >>BCC.Text = ds.Tables("Emai ls").Rows(row)( "bcc_addresses" )
        >>Subject.Tex t = ds.Tables("Emai ls").Rows(row)( "subject")
        >>Body.Text = ds.Tables("Emai ls").Rows(row)( "body")
        >>TabPage1.Send ToBack()
        >>>
        >>and also TabPage1.Visibl e = False but neither worked.
        >>>
        >>How do I get TabPage2 to display programmaticall y?
        >>>
        >>It works fine if I select the tab manually but I want it to
        >>automatical ly display the tabbed page after the data is put on the page.
        >>>
        >>Thanks,
        >>>
        >>Tom
        >>>
        >>
        >>
        >
        >

        Comment

        Working...