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. Tab Control - Disabling a TabPage

Tab Control - Disabling a TabPage

Scheduled Pinned Locked Moved C#
2 Posts 2 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.
  • R Offline
    R Offline
    Ruchi Gupta
    wrote on last edited by
    #1

    Hi, I have a TabControl with 4 TabPages. Based on Access Permissions I want to grey out the selection of a particular TabPage. I used following property to disbale:- tabControlDeal.TabPages[3].Enabled = false But this disables all the controls on TabPages[3], but doesn't greyout TabPage selection. Is there any way out to greyout TabPage selection. Thanks in advance Ruchi

    H 1 Reply Last reply
    0
    • R Ruchi Gupta

      Hi, I have a TabControl with 4 TabPages. Based on Access Permissions I want to grey out the selection of a particular TabPage. I used following property to disbale:- tabControlDeal.TabPages[3].Enabled = false But this disables all the controls on TabPages[3], but doesn't greyout TabPage selection. Is there any way out to greyout TabPage selection. Thanks in advance Ruchi

      H Offline
      H Offline
      Heath Stewart
      wrote on last edited by
      #2

      You could owner-draw the tabs and set the text color to SystemColors.GrayText based on the TabPage.Enabled property. Then, just make sure to reset the focus in case someone clicks on the tab. It's simplistic, but there's not a whole lot you can do with the TabControl provided in the .NET FCL (mostly because there's not a lot you can do with the tab common control it encapsulates).

      Microsoft MVP, Visual C# My Articles

      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