矩形 '{X = 0,Y = 19,宽度= 0,高度= -19}' 不能具有的宽度或高度等于0
无中生有,我得到这个错误:矩形 '{X = 0,Y = 19,宽度= 0,高度= -19}' 不能具有的宽度或高度等于0
System.ArgumentException was unhandled Message="Rectangle '{X=0,Y=19,Width=0,Height=-19}' cannot have a width or height equal to 0."
Source="System.Drawing"
StackTrace:
at System.Drawing.Drawing2D.LinearGradientBrush..ctor(Rectangle rect, Color color1, Color color2, LinearGradientMode linearGradientMode)
at Infragistics.Win.DrawUtility.DrawBackColor(Control control, Graphics graphics, AppearanceData& appearanceData, Rectangle rect, Rectangle invalidRect, Boolean enabled, IDrawCache drawCache, AlphaBlendMode alphaBlendMode, Blend blend)
at Infragistics.Win.DrawUtility.DrawBackColor(Control control, Graphics graphics, AppearanceData& appearanceData, Rectangle rect, Rectangle invalidRect, Boolean enabled, AlphaBlendMode alphaBlendMode)
at Infragistics.Win.UltraWinTabControl.UltraTabPageControl.PaintBackground(PaintEventArgs e)
at Infragistics.Win.UltraWinTabControl.UltraTabPageControl.OnPaintBackground(PaintEventArgs e)
at System.Windows.Forms.Control.PaintTransparentBackground(PaintEventArgs e, Rectangle rectangle, Region transparentRegion)
at System.Windows.Forms.Control.PaintTransparentBackground(PaintEventArgs e, Rectangle rectangle)
at System.Windows.Forms.Control.PaintBackground(PaintEventArgs e, Rectangle rectangle, Color backColor, Point scrollOffset)
at System.Windows.Forms.Control.PaintBackground(PaintEventArgs e, Rectangle rectangle)
at System.Windows.Forms.Control.OnPaintBackground(PaintEventArgs pevent)
at System.Windows.Forms.Control.PaintTransparentBackground(PaintEventArgs e, Rectangle rectangle, Region transparentRegion)
at System.Windows.Forms.Control.PaintTransparentBackground(PaintEventArgs e, Rectangle rectangle)
at System.Windows.Forms.Control.PaintBackground(PaintEventArgs e, Rectangle rectangle, Color backColor, Point scrollOffset)
at System.Windows.Forms.Control.PaintBackground(PaintEventArgs e, Rectangle rectangle)
at System.Windows.Forms.Control.OnPaintBackground(PaintEventArgs pevent)
at System.Windows.Forms.ScrollableControl.OnPaintBackground(PaintEventArgs e)
at System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer)
at System.Windows.Forms.Control.WmEraseBkgnd(Message& m)
at System.Windows.Forms.Control.WndProc(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)
注意:
+我使用Visual Studio 2005中的VB.Net & Infragistics。
+单击另一个选项卡时出现错误。
+如果我使用F5进行调试或在没有调试器的情况下运行,则出现错误,但如果使用F10 &断点进行调试,则不会出现错误。
+我搜索了.designer.vb文件(27000+ codelines!),但没有发现任何线索。
+在另一个.designer.vb文件中,我尝试通过在Rectangle实例化中输入0和负数作为宽度&高度参数来重现错误,然后运行该程序。该错误不会出现。
这个错误一直困扰着我好几天。
有人能指出根本原因和解决方法吗?
请帮忙,并提前致谢。
回答:
将用户控件的属性MaximumSize更改为2000,2000(以前的0,0)后,错误消失。这更像是解决方法,我还没有找到如何工作,因为其他用户控件的MaximumSize(s)也是0,0,但他们工作正常没有错误。
以上是 矩形 '{X = 0,Y = 19,宽度= 0,高度= -19}' 不能具有的宽度或高度等于0 的全部内容, 来源链接: utcz.com/qa/265195.html