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 Events do not fire w/ .Net1.1

TabPage Events do not fire w/ .Net1.1

Scheduled Pinned Locked Moved C#
questioncsharp
5 Posts 3 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.
  • J Offline
    J Offline
    Jeff Jordan
    wrote on last edited by
    #1

    Hello i have a simple windows form with a TabControl and several TabPages. I've added Event Handlers for the TabPage's Enter/Leave/Validating events. The Events never fire! The same code build with VS2005 works! How can i get the Events to work with VS2003 and .Net 1.1:confused:? Michael

    Q 1 Reply Last reply
    0
    • J Jeff Jordan

      Hello i have a simple windows form with a TabControl and several TabPages. I've added Event Handlers for the TabPage's Enter/Leave/Validating events. The Events never fire! The same code build with VS2005 works! How can i get the Events to work with VS2003 and .Net 1.1:confused:? Michael

      Q Offline
      Q Offline
      quiteSmart
      wrote on last edited by
      #2

      You have to be aware that VS 2005 differs a lot from the old ones. Unlike the VS2003 and .Net 1.1 that are much similar to each other. In VS2005 many of the namespaces have changed and many were combined with some other and many new where added.U can't expect for the same coding to work for VS2005 and VS2003. Maybe this is not the case. Maybe you are not fire the events. If you are just copy and pate the source code then you wouldn't be initalizing the events. You should go to each tab seperatly and fire the events. Hope it will benefit you. Jamil abou khalil

      J 1 Reply Last reply
      0
      • Q quiteSmart

        You have to be aware that VS 2005 differs a lot from the old ones. Unlike the VS2003 and .Net 1.1 that are much similar to each other. In VS2005 many of the namespaces have changed and many were combined with some other and many new where added.U can't expect for the same coding to work for VS2005 and VS2003. Maybe this is not the case. Maybe you are not fire the events. If you are just copy and pate the source code then you wouldn't be initalizing the events. You should go to each tab seperatly and fire the events. Hope it will benefit you. Jamil abou khalil

        J Offline
        J Offline
        Jeff Jordan
        wrote on last edited by
        #3

        Thanks but that does not help me:( I simply created a new C# windows app, dragged a TabControl from the Toolbox and added two Tabpages. Then I made to following changes to the resulting code: public Form1 () { InitializeComponent (); this.tabPage1.Leave += new EventHandler ( tabPage1_Leave ); this.tabPage1.Enter += new EventHandler ( tabPage1_Enter ); } void tabPage1_Enter ( object sender, EventArgs e ) { Debug.WriteLine ( "tabPage1_Enter" ); } void tabPage1_Leave ( object sender, EventArgs e ) { Debug.WriteLine ( "tabPage1_Leave" ); } I expect the Events to fire when the user selects a tabpage. That does not happen. The same code imported with VS2005 works! What can I do? Michael

        M 1 Reply Last reply
        0
        • J Jeff Jordan

          Thanks but that does not help me:( I simply created a new C# windows app, dragged a TabControl from the Toolbox and added two Tabpages. Then I made to following changes to the resulting code: public Form1 () { InitializeComponent (); this.tabPage1.Leave += new EventHandler ( tabPage1_Leave ); this.tabPage1.Enter += new EventHandler ( tabPage1_Enter ); } void tabPage1_Enter ( object sender, EventArgs e ) { Debug.WriteLine ( "tabPage1_Enter" ); } void tabPage1_Leave ( object sender, EventArgs e ) { Debug.WriteLine ( "tabPage1_Leave" ); } I expect the Events to fire when the user selects a tabpage. That does not happen. The same code imported with VS2005 works! What can I do? Michael

          M Offline
          M Offline
          mikone
          wrote on last edited by
          #4

          Hi, i don't know when those events are fired (they are not the same as MouseLeave and MouseEnter) but if you want to fire an event when switching/selecting another tabpage you could use the TabControls "TabIndexChanged" event. Make sure you REALLY fire the events. (maybe try mouseenter and mouseleave instead just to make sure that it works at all!)

          J 1 Reply Last reply
          0
          • M mikone

            Hi, i don't know when those events are fired (they are not the same as MouseLeave and MouseEnter) but if you want to fire an event when switching/selecting another tabpage you could use the TabControls "TabIndexChanged" event. Make sure you REALLY fire the events. (maybe try mouseenter and mouseleave instead just to make sure that it works at all!)

            J Offline
            J Offline
            Jeff Jordan
            wrote on last edited by
            #5

            mikone wrote:

            TabControls "TabIndexChanged" event.

            The problem here is that the event is raised after the new tab is drawn. I can reactivate the previous page but then i see the page flicker. What i want to do is prevent the page change. My current solution is to override the OnSelectedIndexChanged(EventArgs e) method. But that looks awfully cumbersome given the fact that I should be able to page enter / page leave events. Only it does not work because there is a bug in .Net 1.1 that has been fixed in version 2.0 Cheers Michael

            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