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
820
Visual Styles-related operation resulted in an error because no visual style is currently active
posted


  I got this error on my (normally stable) application after it had been running overnight.  Attached is a stack trace.   Could it be a bug in the toolbar?

---

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.InvalidOperationException: Visual Styles-related operation resulted in an error because no visual style is currently active.
   at System.Windows.Forms.VisualStyles.VisualStyleRenderer.IsCombinationDefined(String className, Int32 part)
   at System.Windows.Forms.VisualStyles.VisualStyleRenderer..ctor(String className, Int32 part, Int32 state)
   at System.Windows.Forms.VisualStyles.VisualStyleRenderer..ctor(VisualStyleElement element)
   at Infragistics.Win.FormattedLinkLabel.PositionElementsCache.MeasureTextGDIOrThemed(String text, Font font, TextFormatFlags textFormatFlags)
   at Infragistics.Win.FormattedLinkLabel.PositionElementsCache.MeasureCharacterRangesGDI(String text, Font font, TextFormatFlags textFormatFlags, CharacterRange[] ranges)
   at Infragistics.Win.FormattedLinkLabel.PositionElementsCache.ReMeasureParts(String text, Int32[] parts, Single[] widths, Int32 partStartIndex, Int32 partEndIndex, Font font, Single& lineHeight)
   at Infragistics.Win.FormattedLinkLabel.PositionElementsCache.MeasureParts(String text, Int32[] parts, Font font, Single& lineHeight)
   at Infragistics.Win.FormattedLinkLabel.NodeText.TextLayoutInfo.Measure(PositionElementsInfo& info)
   at Infragistics.Win.FormattedLinkLabel.NodeText.PositionSelf(PositionElementsInfo& info)
   at Infragistics.Win.FormattedLinkLabel.NodeBase.PositionHelper(PositionElementsInfo& info)
   at Infragistics.Win.FormattedLinkLabel.NodeBase.Position(PositionElementsInfo& info)
   at Infragistics.Win.FormattedLinkLabel.NodeBase.PositionChildNodes(PositionElementsInfo& info)
   at Infragistics.Win.FormattedLinkLabel.NodeBlock.PositionChildNodes(PositionElementsInfo& info)
   at Infragistics.Win.FormattedLinkLabel.NodeBase.PositionHelper(PositionElementsInfo& info)
   at Infragistics.Win.FormattedLinkLabel.NodeBase.Position(PositionElementsInfo& info)
   at Infragistics.Win.FormattedLinkLabel.NodeBase.CalcSize(IFormattedLinkLabelOwner owner, Graphics graphics, Int32 maxWidth)
   at Infragistics.Win.FormattedLinkLabel.ParsedFormattedTextValue.CalcSize(Graphics graphics, Font baseFont, AppearanceData& defaultAppearance, Int32 widthConstraint, DefaultableBoolean wrapText, GdiDrawStringFlags gdiDrawStringFlags)
   at Infragistics.Win.UltraWinToolbars.Ribbon.RibbonMetrics.CalculateCaptionAreaHeight()
   at Infragistics.Win.UltraWinToolbars.Ribbon.RibbonMetrics.get_CaptionAreaHeight()
   at Infragistics.Win.UltraWinToolbars.Ribbon.RibbonMetrics.get_RibbonHeight()
   at Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea.RefreshDockAreaSize(Size& currentSize)
   at Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea.RefreshDockAreaSize()
   at Infragistics.Win.UltraWinToolbars.UltraToolbarsDockArea.DirtyChildElements()
   at Infragistics.Win.UltraWinToolbars.UltraToolbarsManager.DirtyChildElements(Boolean delegateToMdiParent)
   at Infragistics.Win.UltraWinToolbars.UltraToolbarsManager.DirtyChildElements()
   at Infragistics.Win.UltraWinToolbars.UltraToolbarsManager.DirtyAllElements()
   at Infragistics.Win.UltraWinToolbars.UltraToolbarsManagerRole.OnStyleChanged()
   at Infragistics.Win.AppStyling.ComponentRole.ClearCache(Boolean notifyOwner)
   at Infragistics.Win.AppStyling.ComponentRole.OnAppStyleChanged(Object sender, StyleChangedEventArgs e)
   --- End of inner exception stack trace ---
   at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
   at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
   at System.Delegate.DynamicInvokeImpl(Object[] args)
   at Infragistics.Win.WeakReferenceMulticastDelegate`1.WeakReferenceProxyEventHandler.OnEventFired(Object sender, EventArgsType e, Type delegateType)
   at Infragistics.Win.WeakReferenceMulticastDelegate`1.Invoke(Object sender, EventArgsType e)
   at Infragistics.Win.AppStyling.StyleManager.NotifyThemeChanged()
   at Infragistics.Win.XPThemes.OnThemeChangeMessage(Object sender, EventArgs e)
   at Infragistics.Win.XPThemes.ThemeManagerForm.OnThemeChanged(EventArgs e)
   at Infragistics.Win.XPThemes.ThemeManagerForm.OnNotifyMessage(Message m)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
   at System.Windows.Forms.ContainerControl.WndProc(Message& m)
   at System.Windows.Forms.Form.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
   at System.Windows.Forms.UnsafeNativeMethods.PeekMessage(MSG& msg, HandleRef hwnd, Int32 msgMin, Int32 msgMax, Int32 remove)
   at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
   at System.Windows.Forms.Application.Run(Form mainForm)