locked
How can I dynamically change the icon of my add-in displayed by the TabControl? RRS feed

  • Question

  • I want to display a different icon in the tabcontrol based on the state of my add-in?  I believe the MS Home Network Health add-in does this. 

    Any ideas how to code this?
    Monday, February 22, 2010 6:23 AM

Answers

  • If you dig through the main console form using Reflector, you can see that the health TabButton is a special case. The WHS Console keeps track of it separately, and overrides the Paint handler to draw the correct icon based on the current health state.

    The TabButton is what WHS creates when it instantiates your Add-In; we can't reference the TabButton that WHS creates from our add-in (the list of TabButtons is private, for a start). Because of this, we can't override the Paint handler to draw our own images.

    I think you're out of luck on this one.
    Tentacle Blog: http://www.tentaclesoftware.com/blog/
    WHS Disk Management: http://www.tentaclesoftware.com/WHSDiskManagement/
    Monday, February 22, 2010 9:01 AM
    Moderator