Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. TABPAGE

TABPAGE

Scheduled Pinned Locked Moved C#
helpquestion
15 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S sachees123

    I want to envoke some method when user click on tab of tabpage. Clicking on tab of tabpage is not working but if click on any portion of tab page it works /*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/    private void tabPageAccount_Click(object sender, EventArgs e)             {                   MessageBox.Show("in tab 3");             } /*/*/*/*/*/*/*/*/*/*/*/*/*/**/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/* wats the problem?? Wats the solution?

    OriginalGriffO Offline
    OriginalGriffO Offline
    OriginalGriff
    wrote on last edited by
    #3

    Try using the TabControl class - it contains the TabPage controls and handles the tab selection - as you would expect.

    No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced. This message is made of fully recyclable Zeros and Ones "Rumour has it that if you play Microsoft CDs backwards you will hear Satanic messages.Worse still, is that if you play them forwards they will install Windows"

    "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
    "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

    S R 2 Replies Last reply
    0
    • OriginalGriffO OriginalGriff

      Try using the TabControl class - it contains the TabPage controls and handles the tab selection - as you would expect.

      No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced. This message is made of fully recyclable Zeros and Ones "Rumour has it that if you play Microsoft CDs backwards you will hear Satanic messages.Worse still, is that if you play them forwards they will install Windows"

      S Offline
      S Offline
      sachees123
      wrote on last edited by
      #4

      NO i didnt work.. i tried void tabPageAccount_MouseClick(object sender, System.Windows.Forms.MouseEventArgs e)             {                         } but this also dont work... why is this so that it work if i click on container but not when i click on tab???

      OriginalGriffO 1 Reply Last reply
      0
      • OriginalGriffO OriginalGriff

        Try using the TabControl class - it contains the TabPage controls and handles the tab selection - as you would expect.

        No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced. This message is made of fully recyclable Zeros and Ones "Rumour has it that if you play Microsoft CDs backwards you will hear Satanic messages.Worse still, is that if you play them forwards they will install Windows"

        R Offline
        R Offline
        rajeeshrer
        wrote on last edited by
        #5

        i like your Signature "No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced. This message is made of fully recyclable Zeros and Ones" me also copied :thumbsup:

        OriginalGriffO 1 Reply Last reply
        0
        • S sachees123

          NO i didnt work.. i tried void tabPageAccount_MouseClick(object sender, System.Windows.Forms.MouseEventArgs e)             {                         } but this also dont work... why is this so that it work if i click on container but not when i click on tab???

          OriginalGriffO Offline
          OriginalGriffO Offline
          OriginalGriff
          wrote on last edited by
          #6

          So, just to recap, what you want is: 1) You have a tab control, with tab pages. 2) When you click on the tab, you want an event to fire. 3) You have tried "mouse_click" for the page. I say again: try the control. I created a form, with a tab control. I added handlers for the Click and MouseClick events of the tab control. Each handler has a MessageBox.Show command with a different string to display. When I click on the tab, it selects the appropriate tab page, and I get two message boxes. What have I done, that you haven't, or that you have done that I haven't?

          namespace Testy
          {
          public partial class frmTabs : Form
          {
          public frmTabs()
          {
          InitializeComponent();
          }

              private void tabControl1\_Click(object sender, EventArgs e)
                  {
                  MessageBox.Show("He Clicks! He Scores!");
                  }
          
              private void tabControl1\_MouseClick(object sender, MouseEventArgs e)
                  {
                  MessageBox.Show("He Clicks the Mouse! He Misses!");
                  }
              }
          }
          

          No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced. This message is made of fully recyclable Zeros and Ones "Rumour has it that if you play Microsoft CDs backwards you will hear Satanic messages.Worse still, is that if you play them forwards they will install Windows"

          "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
          "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

          S 2 Replies Last reply
          0
          • R rajeeshrer

            i like your Signature "No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced. This message is made of fully recyclable Zeros and Ones" me also copied :thumbsup:

            OriginalGriffO Offline
            OriginalGriffO Offline
            OriginalGriff
            wrote on last edited by
            #7

            Thank you - help yorself, I was thinking of changing them soon anyway!

            No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced. This message is made of fully recyclable Zeros and Ones "Rumour has it that if you play Microsoft CDs backwards you will hear Satanic messages.Worse still, is that if you play them forwards they will install Windows"

            "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
            "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

            1 Reply Last reply
            0
            • S sachees123

              I want to envoke some method when user click on tab of tabpage. Clicking on tab of tabpage is not working but if click on any portion of tab page it works /*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/    private void tabPageAccount_Click(object sender, EventArgs e)             {                   MessageBox.Show("in tab 3");             } /*/*/*/*/*/*/*/*/*/*/*/*/*/**/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/*/* wats the problem?? Wats the solution?

              S Offline
              S Offline
              sparlay_pk
              wrote on last edited by
              #8

              private void onclicktab(object sender, EventArgs e) { label1.Text = tabControl1.SelectedIndex.ToString(); }

              S 1 Reply Last reply
              0
              • OriginalGriffO OriginalGriff

                So, just to recap, what you want is: 1) You have a tab control, with tab pages. 2) When you click on the tab, you want an event to fire. 3) You have tried "mouse_click" for the page. I say again: try the control. I created a form, with a tab control. I added handlers for the Click and MouseClick events of the tab control. Each handler has a MessageBox.Show command with a different string to display. When I click on the tab, it selects the appropriate tab page, and I get two message boxes. What have I done, that you haven't, or that you have done that I haven't?

                namespace Testy
                {
                public partial class frmTabs : Form
                {
                public frmTabs()
                {
                InitializeComponent();
                }

                    private void tabControl1\_Click(object sender, EventArgs e)
                        {
                        MessageBox.Show("He Clicks! He Scores!");
                        }
                
                    private void tabControl1\_MouseClick(object sender, MouseEventArgs e)
                        {
                        MessageBox.Show("He Clicks the Mouse! He Misses!");
                        }
                    }
                }
                

                No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced. This message is made of fully recyclable Zeros and Ones "Rumour has it that if you play Microsoft CDs backwards you will hear Satanic messages.Worse still, is that if you play them forwards they will install Windows"

                S Offline
                S Offline
                sachees123
                wrote on last edited by
                #9

                Thanks for your effort. Wat u said is perfectly right. But wat i want is: private void tabPage1_Click(object sender, EventArgs e)             {                Message.Show("In Tab 1");             } private void tabPage2_Click(object sender, EventArgs e)             {                Message.Show("In Tab 2");             } clcik on tab and not on tab control. Hope u got my problem

                OriginalGriffO 1 Reply Last reply
                0
                • S sparlay_pk

                  private void onclicktab(object sender, EventArgs e) { label1.Text = tabControl1.SelectedIndex.ToString(); }

                  S Offline
                  S Offline
                  sachees123
                  wrote on last edited by
                  #10

                  will this code solve my problem.....????

                  1 Reply Last reply
                  0
                  • OriginalGriffO OriginalGriff

                    So, just to recap, what you want is: 1) You have a tab control, with tab pages. 2) When you click on the tab, you want an event to fire. 3) You have tried "mouse_click" for the page. I say again: try the control. I created a form, with a tab control. I added handlers for the Click and MouseClick events of the tab control. Each handler has a MessageBox.Show command with a different string to display. When I click on the tab, it selects the appropriate tab page, and I get two message boxes. What have I done, that you haven't, or that you have done that I haven't?

                    namespace Testy
                    {
                    public partial class frmTabs : Form
                    {
                    public frmTabs()
                    {
                    InitializeComponent();
                    }

                        private void tabControl1\_Click(object sender, EventArgs e)
                            {
                            MessageBox.Show("He Clicks! He Scores!");
                            }
                    
                        private void tabControl1\_MouseClick(object sender, MouseEventArgs e)
                            {
                            MessageBox.Show("He Clicks the Mouse! He Misses!");
                            }
                        }
                    }
                    

                    No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced. This message is made of fully recyclable Zeros and Ones "Rumour has it that if you play Microsoft CDs backwards you will hear Satanic messages.Worse still, is that if you play them forwards they will install Windows"

                    S Offline
                    S Offline
                    sachees123
                    wrote on last edited by
                    #11

                    can u plz provide me ur email id?? i want to send u the screen shots of my project

                    OriginalGriffO 1 Reply Last reply
                    0
                    • S sachees123

                      Thanks for your effort. Wat u said is perfectly right. But wat i want is: private void tabPage1_Click(object sender, EventArgs e)             {                Message.Show("In Tab 1");             } private void tabPage2_Click(object sender, EventArgs e)             {                Message.Show("In Tab 2");             } clcik on tab and not on tab control. Hope u got my problem

                      OriginalGriffO Offline
                      OriginalGriffO Offline
                      OriginalGriff
                      wrote on last edited by
                      #12

                      Um. The clue is in the question:

                      sachees123 wrote:

                      private void tabPage1_Click(object sender, EventArgs e)
                      {
                      Message.Show("In Tab 1");
                      }

                      private void tabPage2_Click(object sender, EventArgs e)
                      {
                      Message.Show("In Tab 2");
                      }

                      try:

                          private void tabControl1\_Click(object sender, EventArgs e)
                              {
                              TabControl tc = sender as TabControl;
                              TabPage tp = tc.SelectedTab;
                      
                              MessageBox.Show("He Clicks! He Scores!" + tp.Text);
                              }
                      

                      No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced. This message is made of fully recyclable Zeros and Ones "Rumour has it that if you play Microsoft CDs backwards you will hear Satanic messages.Worse still, is that if you play them forwards they will install Windows"

                      "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
                      "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

                      1 Reply Last reply
                      0
                      • S sachees123

                        can u plz provide me ur email id?? i want to send u the screen shots of my project

                        OriginalGriffO Offline
                        OriginalGriffO Offline
                        OriginalGriff
                        wrote on last edited by
                        #13

                        No. Never post your email to any forum. Not unless you want to be spammed to death, anyway. Why would I need screen shots?

                        No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced. This message is made of fully recyclable Zeros and Ones "Rumour has it that if you play Microsoft CDs backwards you will hear Satanic messages.Worse still, is that if you play them forwards they will install Windows"

                        "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
                        "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

                        S 1 Reply Last reply
                        0
                        • OriginalGriffO OriginalGriff

                          No. Never post your email to any forum. Not unless you want to be spammed to death, anyway. Why would I need screen shots?

                          No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced. This message is made of fully recyclable Zeros and Ones "Rumour has it that if you play Microsoft CDs backwards you will hear Satanic messages.Worse still, is that if you play them forwards they will install Windows"

                          S Offline
                          S Offline
                          sachees123
                          wrote on last edited by
                          #14

                          Just to make u understand the gravity of the problem. But i dont think NOW it need to. As problem is solved. Thanks a LOT..

                          OriginalGriffO 1 Reply Last reply
                          0
                          • S sachees123

                            Just to make u understand the gravity of the problem. But i dont think NOW it need to. As problem is solved. Thanks a LOT..

                            OriginalGriffO Offline
                            OriginalGriffO Offline
                            OriginalGriff
                            wrote on last edited by
                            #15

                            You're welcome!

                            No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced. This message is made of fully recyclable Zeros and Ones "Rumour has it that if you play Microsoft CDs backwards you will hear Satanic messages.Worse still, is that if you play them forwards they will install Windows"

                            "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
                            "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

                            1 Reply Last reply
                            0
                            Reply
                            • Reply as topic
                            Log in to reply
                            • Oldest to Newest
                            • Newest to Oldest
                            • Most Votes


                            • Login

                            • Don't have an account? Register

                            • Login or register to search.
                            • First post
                              Last post
                            0
                            • Categories
                            • Recent
                            • Tags
                            • Popular
                            • World
                            • Users
                            • Groups