Hi,
we are facing the "Parameter is not valid."
at System.Drawing.Graphics.GetHdc()
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.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.UltraToolbarsDockArea.CalculateGlassRect()
at Infragistics.Win.UltraWinToolbars.UltraToolbarsManager.ExtendGlassIntoRibbon(IntPtr handle)
at Infragistics.Win.UltraWinToolbars.UltraToolbarsManager.RefreshGlass()
at Infragistics.Win.UltraWinToolbars.Ribbon.RibbonMetrics.Dirty(RibbonMetricsFlags flags)
at Infragistics.Win.UltraWinToolbars.Ribbon.OnFormCaptionChanged()
at Infragistics.Win.UltraWinToolbars.UltraToolbarsManager.OnFormTextChanged(Object sender, EventArgs e)
at System.EventHandler.Invoke(Object sender, EventArgs e)
at System.Windows.Forms.Control.OnTextChanged(EventArgs e)
at System.Windows.Forms.Form.OnTextChanged(EventArgs e)
at System.Windows.Forms.Control.set_Text(String value)
at System.Windows.Forms.Form.set_Text(String value)
Thank you for the provided stack trace.
We still can’t reproduce this issue internally and ultimately without a sample, I can’t log this case for further investigation. Let me know if you are able to isolate it, it will be really appreciated. I would be glad to research this once I have a sample.
We are having the same problem. I cannot give sample code due to the size of our code base along with the fact that it is difficult to reproduce and occurs intermittently. One of our customers gave us a stack trace exception report though:
Exception Count: 7
Exception Source: System.Drawing
Exception Type: System.ArgumentException
Exception Message: Parameter is not valid.
Exception Target Site: GetHdc
---- Stack Trace ----
System.Drawing.Graphics.GetHdc()
System.Drawing.dll : N 1622627
Infragistics.Win.FormattedLinkLabel.PositionElementsCache.MeasureTextGDIOrThemed(String text, Font font, TextFormatFlags textFormatFlags)
Infragistics4.Win.v13.1.DLL : N 00249
Infragistics.Win.FormattedLinkLabel.PositionElementsCache.MeasureCharacterRangesGDI(String text, Font font, TextFormatFlags textFormatFlags, CharacterRange[] ranges)
Infragistics4.Win.v13.1.DLL : N 00198
Infragistics.Win.FormattedLinkLabel.PositionElementsCache.ReMeasureParts(String text, Int32[] parts, Single[] widths, Int32 partStartIndex, Int32 partEndIndex, Font font, Single& lineHeight)
Infragistics4.Win.v13.1.DLL : N 00683
Infragistics.Win.FormattedLinkLabel.TextLayoutInfo.Measure(PositionElementsInfo& info)
Infragistics4.Win.v13.1.DLL : N 00127
Infragistics.Win.FormattedLinkLabel.NodeText.PositionSelf(PositionElementsInfo& info)
Infragistics4.Win.v13.1.DLL : N 00735
Infragistics.Win.FormattedLinkLabel.NodeBase.PositionHelper(PositionElementsInfo& info)
Infragistics4.Win.v13.1.DLL : N 00073
Infragistics.Win.FormattedLinkLabel.NodeBase.PositionChildNodes(PositionElementsInfo& info)
Infragistics4.Win.v13.1.DLL : N 00032
Infragistics.Win.FormattedLinkLabel.NodeBlock.PositionChildNodes(PositionElementsInfo& info)
Infragistics4.Win.v13.1.DLL : N 01110
Infragistics.Win.FormattedLinkLabel.NodeBase.PositionElements(IFormattedLinkLabelOwner owner, UIElement containerElem, Rectangle containerRect, Boolean calcIdealLayoutSize, Size& layoutSize)
Infragistics4.Win.v13.1.DLL : N 00413
Infragistics.Win.FormattedLinkLabel.FormattedTextUIElement.PositionElementsHelper(Rectangle layoutRect, Boolean setElemRectToIdealSize)
Infragistics4.Win.v13.1.DLL : N 00214
Infragistics.Win.FormattedLinkLabel.FormattedTextUIElement.PositionChildElements()
Infragistics4.Win.v13.1.DLL : N 00068
Infragistics.Win.UIElement.VerifyChildElements(ControlUIElementBase controlElement, Boolean recursive)
Infragistics4.Win.v13.1.DLL : N 00173
Infragistics4.Win.v13.1.DLL : N 00305
Infragistics.Win.UIElement.VerifyChildElements(Boolean recursive)
Infragistics4.Win.v13.1.DLL : N 00109
Infragistics.Win.ControlUIElementBase.VerifyIfElementsChanged(Boolean verify, Boolean syncMouseEntered)
Infragistics4.Win.v13.1.DLL : N 00048
Infragistics.Win.ControlUIElementBase.get_CurrentCursor()
Infragistics4.Win.v13.1.DLL : N 00031
Infragistics.Win.UltraControlBase.get_Cursor()
Infragistics4.Win.v13.1.DLL : N 00063
System.Windows.Forms.Control.WmSetCursor(Message& m)
System.Windows.Forms.dll : N 00068
System.Windows.Forms.Control.WndProc(Message& m)
System.Windows.Forms.dll : N 01358
System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
System.Windows.Forms.dll : N 00346
Hello Waqas,
Thank you for your reply.
I have tried to reproduce it using v11.2.20112.1010 and everything works correctly. Is the grid necessary to reproduce the issue? Can you reproduce it if you remove the grid? Do you change the tabs asynchronously? I have attached my test sample in which I load more than 100 000 rows with images and switch the tabs asynchronously. Please modify it so it reproduces the issue and I will be glad to research this further.
I am looking forward to your reply.
I am using 11.2 version. This issue is happening every time. am sorry i cannot post code here due to company privacy rule. but i can explain situation in which this exception occur and big red cross appears instead of tool bar.
I am loading a huge dataset in ultragrid (Image column included in every row). while this grid is being loaded i start changing tabs (on tab change i am just setting text on toolbar nothing else). This exception occurs and big red cross appears instead of toolbar.
Hi Wagas,
Thank you for contacting Infragistics Developer Support.
What version of Infragistics for Windows Forms are you using? When is the issue happening? Can you give us steps to reproduce the issue? Does it happen randomly or you can reproduce it every time? Can you provide me with a sample that reproduces this issue?