Profile Picture

NTabControl with NTabControlRenderer doesn't work

Posted By Craig Swearingen 12 Years Ago
Author
Message
Craig Swearingen
Posted 12 Years Ago
View Quick Profile
Supreme Being

Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)

Group: Forum Members
Last Active: 7 Years Ago
Posts: 99, Visits: 654

I've added a custom NTabControlRenderer to my NTabControl so I can paint the tab background the mouse over highlight color at times.  I've overridden the DrawTabBackground method to do this drawing.

It doesn't get called when the application has a skin (i.e. like MacOS).  It works as expected when there is no skin.

Is there any way I can make this work with a skin?



Nevron Support
Posted 12 Years Ago
View Quick Profile
Supreme Being

Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)Supreme Being (4,329 reputation)

Group: Forum Members
Last Active: Last Year
Posts: 3,039, Visits: 3,746
Hi Craig,

Here is the source of the original DrawTabBackground:

protected virtual void DrawTabBackground(Graphics g)
{
   if(m_Skin != null)
   {
      if(DrawSkinBackground(g))
         return;
   }

   switch(m_Tab.m_Info.Style)
   {
      case TabStyle.Standard:
         DrawTabStandardBackground(g);
         break;
      case TabStyle.Buttons:
         DrawTabButtonsBackground(g);
         break;
      case TabStyle.MultiDocument:
         DrawTabMultiDocBackground(g);
         break;
   }
}

May be better solution will be to override DrawTabStandardBackground if you use only standard tab style, and DrawSkinBackgorund methods.

Best Regards,
Nevron Support Team



Craig Swearingen
Posted 12 Years Ago
View Quick Profile
Supreme Being

Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)

Group: Forum Members
Last Active: 7 Years Ago
Posts: 99, Visits: 654
Thanks for the tip.  I tried also overriding the DrawSkinBackground and I was able to get this event when a skin was present and do a different highlight.  I think that can work for now.



Similar Topics


Reading This Topic