/// <summary> /// Creates new instance of the object. /// </summary> public BaseItemControl() { if (!ColorFunctions.ColorsLoaded) { NativeFunctions.RefreshSettings(); NativeFunctions.OnDisplayChange(); ColorFunctions.LoadColors(); } this.SetStyle(ControlStyles.UserPaint, true); this.SetStyle(ControlStyles.AllPaintingInWmPaint, true); this.SetStyle(ControlStyles.Opaque, true); this.SetStyle(ControlStyles.ResizeRedraw, true); this.SetStyle(ControlStyles.StandardDoubleClick, true); this.SetStyle(DisplayHelp.DoubleBufferFlag, true); this.SetStyle(ControlStyles.SupportsTransparentBackColor, true); m_ColorScheme = new ColorScheme(eDotNetBarStyle.Office2007); m_BackgroundStyle = new ElementStyle(); m_BackgroundStyle.SetColorScheme(m_ColorScheme); m_BackgroundStyle.StyleChanged += new EventHandler(this.VisualPropertyChanged); }
public RibbonBar() { //this.BackColor = Color.Transparent; m_ItemContainer=new ItemContainer(); m_ItemContainer.GlobalItem=false; m_ItemContainer.ContainerControl=this; m_ItemContainer.Stretch=false; m_ItemContainer.Displayed=true; m_ItemContainer.Style=eDotNetBarStyle.StyleManagerControlled; this.ColorScheme.Style=eDotNetBarStyle.StyleManagerControlled; m_ItemContainer.SetOwner(this); m_ItemContainer.SetSystemContainer(true); this.SetBaseItemContainer(m_ItemContainer); this.DragDropSupport = true; m_TitleStyle=new ElementStyle(); m_TitleStyle.SetColorScheme(this.GetColorScheme()); m_TitleStyle.StyleChanged+=new EventHandler(ElementStyleChanged); m_TitleStyleMouseOver = new ElementStyle(); m_TitleStyleMouseOver.SetColorScheme(this.GetColorScheme()); m_TitleStyleMouseOver.StyleChanged += new EventHandler(ElementStyleChanged); m_BackgroundMouseOverStyle.SetColorScheme(this.GetColorScheme()); m_BackgroundMouseOverStyle.StyleChanged += new EventHandler(this.VisualPropertyChanged); this.ItemAdded += new EventHandler(RibbonBar_ItemAdded); this.ItemRemoved += new ItemRemovedEventHandler(RibbonBar_ItemRemoved); }
/// <summary> /// Resets the style to it's default value. /// </summary> public void ResetStyleMouseDown() { if(m_StyleMouseDown==null) { m_StyleMouseDown = new ElementStyle(); m_StyleMouseDown.SetColorScheme(GetColorScheme()); m_StyleMouseDown.StyleChanged += new EventHandler(this.OnVisualPropertyChanged); } else m_StyleMouseDown.Reset(); this.Invalidate(); }
/// <summary> /// Resets the style to it's default value. /// </summary> public void ResetStyle() { if(m_Style==null) { // Set default style m_Style = new ElementStyle(); m_Style.SetColorScheme(GetColorScheme()); m_Style.StyleChanged += new EventHandler(this.OnVisualPropertyChanged); } else m_Style.Reset(); RefreshStyleSystemColors(); this.Invalidate(); }