Results 1 to 2 of 2

Thread: [2.0] ContextMenu on a TabPage

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Jan 2005
    Location
    Cebu
    Posts
    607

    [2.0] ContextMenu on a TabPage

    Maybe I'm missing something... Is there a way I can setup a ContextMenu on a TabPage and not on the TabControl?

    Thanks.
    Last edited by nebulom; Jun 5th, 2007 at 09:46 PM.

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: [2.0] ContextMenu on a TabPage

    That depends on exactly what you mean. The TabControl has a ContextMenuStrip property, as does each TabPage. You can assign a menu to that property of each page and when you right-click a page that menu will be displayed.

    Having said that, it is important to note that the tabs displayed along the top of the control are NOT part of the TabPages, so if you right-click one of them you'll see the TabControl's ContextMenuStrip.

    If you don't want that behaviour then you'll have to change it yourself. You'd have to determine which tab was clicked using the sizes of the tabs and the mouse coordinates, then display your preferred menu manually.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width