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. changing the appearance of Tab in tab control

changing the appearance of Tab in tab control

Scheduled Pinned Locked Moved C#
graphicsquestion
4 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.
  • K Offline
    K Offline
    KrunalC
    wrote on last edited by
    #1

    In my application, I want to change the appearance of the tab (not the tab page itself) (i.e. font of Tab text, background of the tab etc.). I know I need to set the draw mode property of the tab control to owner mode and handle the drawitem event. But drawitem event fires at the time when tabs are drawn. Once my application is up and running I'm not drawing the tab. Can any one pls let me know how i can change the appearance of the tab at runtime? e.g. I have got one button on my tab page and if I click that button the back color of tab should change. thanks,

    M 1 Reply Last reply
    0
    • K KrunalC

      In my application, I want to change the appearance of the tab (not the tab page itself) (i.e. font of Tab text, background of the tab etc.). I know I need to set the draw mode property of the tab control to owner mode and handle the drawitem event. But drawitem event fires at the time when tabs are drawn. Once my application is up and running I'm not drawing the tab. Can any one pls let me know how i can change the appearance of the tab at runtime? e.g. I have got one button on my tab page and if I click that button the back color of tab should change. thanks,

      M Offline
      M Offline
      Martin 0
      wrote on last edited by
      #2

      Hello,

      KrunalC wrote:

      I know I need to set the draw mode property of the tab control to owner mode and handle the drawitem event.

      You should stay at this solution. At the button click, you could use the TabControl.Refresh() method. This will redraw the TabControl and it's TabPages. All the best, Martin

      K 1 Reply Last reply
      0
      • M Martin 0

        Hello,

        KrunalC wrote:

        I know I need to set the draw mode property of the tab control to owner mode and handle the drawitem event.

        You should stay at this solution. At the button click, you could use the TabControl.Refresh() method. This will redraw the TabControl and it's TabPages. All the best, Martin

        K Offline
        K Offline
        KrunalC
        wrote on last edited by
        #3

        Thanks for the reply. Problem was because of my false understanding. I was under impression that tab of the page is part of tabpage and not the tabcontrol. so I was updating the tabpage in draw item rather than tab control. With the tab control update things are working.

        M 1 Reply Last reply
        0
        • K KrunalC

          Thanks for the reply. Problem was because of my false understanding. I was under impression that tab of the page is part of tabpage and not the tabcontrol. so I was updating the tabpage in draw item rather than tab control. With the tab control update things are working.

          M Offline
          M Offline
          Martin 0
          wrote on last edited by
          #4

          Oh, Good work! All the best, Martin

          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