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. Windows Forms Tab Control

Windows Forms Tab Control

Scheduled Pinned Locked Moved C#
winformshelpquestion
3 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.
  • A Offline
    A Offline
    Aryadip
    wrote on last edited by
    #1

    Hi all, I'm trying to select a tab from the windows form's standard tab control on right clicking of mouse button. The mouse event args gives me the location of the mouse pointer. But the tab control doesn't expose any method or property to get the tab on which my mouse pointer is hovering. Has anyone of you faced similar problem like this ? Or atleast it will be nice if anyone can show me a pointer towards solving this problem. Hoping to hear from you guys... Thanks and regards,

    D C 2 Replies Last reply
    0
    • A Aryadip

      Hi all, I'm trying to select a tab from the windows form's standard tab control on right clicking of mouse button. The mouse event args gives me the location of the mouse pointer. But the tab control doesn't expose any method or property to get the tab on which my mouse pointer is hovering. Has anyone of you faced similar problem like this ? Or atleast it will be nice if anyone can show me a pointer towards solving this problem. Hoping to hear from you guys... Thanks and regards,

      D Offline
      D Offline
      Darryl Borden
      wrote on last edited by
      #2

      You might try this approach... You can get the coordinates of each tab on the DrawItem event. If you could save those locations and sizes of each tab every time the tab control is drawn, then in the mousedown event you can identify which tab was clicked on by referring to your saved information. Good Luck! Darryl Borden Principal IT Analyst dborden@eprod.com

      1 Reply Last reply
      0
      • A Aryadip

        Hi all, I'm trying to select a tab from the windows form's standard tab control on right clicking of mouse button. The mouse event args gives me the location of the mouse pointer. But the tab control doesn't expose any method or property to get the tab on which my mouse pointer is hovering. Has anyone of you faced similar problem like this ? Or atleast it will be nice if anyone can show me a pointer towards solving this problem. Hoping to hear from you guys... Thanks and regards,

        C Offline
        C Offline
        Curtis Schlak
        wrote on last edited by
        #3

        The way to do it is to iterate over the tab pages and for each one call TabControl.GetTabRect. If your mouse coordinate exists inside the returned rectange, set that tab to the selected tab. "we must lose precision to make significant statements about complex systems." -deKorvin on uncertainty

        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