Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
80
Hot-tracking of selected tab
posted

I am working in 2007 Vol 3 (and VS 2008), and I've run into an issue I can't quite get fixed.

I have an UltraTabControl with the Office2007 visual style.  I turned on hot-tracking of tabs, and I've set up the control's SelectedTabAppearance and HotTrackAppearance the way I want.  But I don't want the selected tab to use the HotTrackAppearance when it becomes the hot-tracked tab.  After much fiddling, I ended up creating a custom draw-filter class for the "BeforeDrawElement" phase that sets the HotTrackAppearance property of the appropriate tab based on whether it's the selected tab.

This solution works - sort of.  I'm still getting some visual changes on the selected tab.  Specifically, the text-color change is still being applied, and it appears that some of the glow effects from the Office 2007 style are being applied.  The glow effect is particularly odd, since it only happens on the hot-track of the selected tab.

Ultimately, I'd like to turn off hot-tracking for the selected tab, but that doesn't seem to be possible.  And I'll take the glow effect, but I'd really like to solve the text-color change.  I'm guessing that I need to trap for more UI element phases, but I really don't know.

Any help would be appreciated.  Thanks!

- Scott

Parents
No Data
Reply
  • 37774
    posted

    Scott,

    The glow is actually drawn by a different UIElement that surrounds the tab, so you would have to trap for that element to prevent the drawing.  The UIElementViewer utility is pretty useful for things like this, if you don't have it already.  As for preventing the color of the tab from changing when it's active and selected, I don't know if there's anything you can trap to change the appearance, if handling the BeforeDraw phase isn't working for you; you may have to draw the text yourself.   Another option you might want to look into is using AppStylist, since there is a HotTrackSeleted role on the tab item that you could set that would affect this.  If you go this route, I think that you'd still have to prevent the glow from being drawn, though.

    -Matt

Children
No Data