|
// Applying the Customized Renderer to Control
tabbedMDIManager1.TabStyle = typeof(TabRendererMSOffice2007);
public class TabRendererMSOffice2007 : TabRendererOffice2007
{
static TabUIDefaultProperties tabPanelPropertyExtender;
// Exposes the default appearance properties to the tab panel renderer.
public static new TabUIDefaultProperties TabPanelPropertyExtender
{
get { return tabPanelPropertyExtender; }
}
// Specifies the name by which this renderer will be identified.
public static new string TabStyleName
{
get { return "MSOffice2007"; }
}
static TabRendererMSOffice2007()
{
tabPanelPropertyExtender = new TabUIDefaultProperties();
TabRendererFactory.RegisterTabType(TabStyleName, typeof(TabRendererMSOffice2007), TabPanelPropertyExtender);
}
public TabRendererMSOffice2007(ITabControl parent, ITabPanelRenderer panelRenderer) : base(parent, panelRenderer)
{ }
protected override RectangleF GetCloseButtonBounds(DrawTabEventArgs drawItemInfo)
{
// Get the close button bounds and change the size, as needed.
RectangleF rect = base.GetCloseButtonBounds(drawItemInfo);
rect.Width = 10;
rect.Height = 10;
return rect;
}
|