﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>StrataFrame Forum » StrataFrame Application Framework - V1 » WinForms (How do I?)  » Odd ThemedSplitContainer Behavior</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Tue, 09 Jun 2026 09:05:17 GMT</lastBuildDate><ttl>20</ttl><item><title>Odd ThemedSplitContainer Behavior</title><link>http://forum.strataframe.net/FindPost20549.aspx</link><description>If I minimize a form that has this control on it (orientation: horizontal), then restore the form, I get the following error:&lt;/P&gt;&lt;P&gt;[quote]&lt;BR&gt;System.ArgumentException was unhandled by user code&lt;BR&gt;&amp;nbsp; Message="Rectangle '{X=0,Y=70,Width=0,Height=4}' cannot have a width or height equal to 0."&lt;BR&gt;&amp;nbsp; Source="System.Drawing"&lt;BR&gt;&amp;nbsp; StackTrace:&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at System.Drawing.Drawing2D.LinearGradientBrush..ctor(Rectangle rect, Color color1, Color color2, LinearGradientMode linearGradientMode)&amp;nbsp;&amp;nbsp;&amp;nbsp; at MicroFour.StrataFrame.UI.Windows.Forms.ThemedSplitContainer.RenderHorizontalBar(Graphics DrawObj)&amp;nbsp;&amp;nbsp;&amp;nbsp; at MicroFour.StrataFrame.UI.Windows.Forms.ThemedSplitContainer.OnPaint(PaintEventArgs e)&amp;nbsp;&amp;nbsp;&amp;nbsp; at System.Windows.Forms.Control.PaintTransparentBackground(PaintEventArgs e, Rectangle rectangle, Region transparentRegion)&amp;nbsp;&amp;nbsp;&amp;nbsp; at System.Windows.Forms.Control.PaintTransparentBackground(PaintEventArgs e, Rectangle rectangle)&amp;nbsp;&amp;nbsp;&amp;nbsp; at System.Windows.Forms.Control.PaintBackground(PaintEventArgs e, Rectangle rectangle, Color backColor, Point scrollOffset)&amp;nbsp;&amp;nbsp;&amp;nbsp; at System.Windows.Forms.Control.PaintBackground(PaintEventArgs e, Rectangle rectangle)&amp;nbsp;&amp;nbsp;&amp;nbsp; at System.Windows.Forms.Control.OnPaintBackground(PaintEventArgs pevent)&amp;nbsp;&amp;nbsp;&amp;nbsp; at System.Windows.Forms.ScrollableControl.OnPaintBackground(PaintEventArgs e)&amp;nbsp;&amp;nbsp;&amp;nbsp; at System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer, Boolean disposeEventArgs)&amp;nbsp;&amp;nbsp;&amp;nbsp; at System.Windows.Forms.Control.WmEraseBkgnd(Message&amp;amp; m)&amp;nbsp;&amp;nbsp;&amp;nbsp; at System.Windows.Forms.Control.WndProc(Message&amp;amp; m)&amp;nbsp;&amp;nbsp;&amp;nbsp; at System.Windows.Forms.ScrollableControl.WndProc(Message&amp;amp; m)&amp;nbsp;&amp;nbsp;&amp;nbsp; at System.Windows.Forms.Control.ControlNative&amp;#119;indow.OnMessage(Message&amp;amp; m)&amp;nbsp;&amp;nbsp;&amp;nbsp; at System.Windows.Forms.Control.ControlNative&amp;#119;indow.WndProc(Message&amp;amp; m)&amp;nbsp;&amp;nbsp;&amp;nbsp; at System.Windows.Forms.Native&amp;#119;indow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)&lt;BR&gt;&amp;nbsp; InnerException: &lt;BR&gt;[/quote]&lt;/P&gt;&lt;P&gt;How would I correct this problem?&lt;/P&gt;&lt;P&gt;Thanks,&lt;BR&gt;Bill</description><pubDate>Fri, 07 Nov 2008 10:29:40 GMT</pubDate><dc:creator>Bill Cunnien</dc:creator></item><item><title>RE: Odd ThemedSplitContainer Behavior</title><link>http://forum.strataframe.net/FindPost20615.aspx</link><description>Will do.&amp;nbsp; Thanks.</description><pubDate>Fri, 07 Nov 2008 10:29:40 GMT</pubDate><dc:creator>Bill Cunnien</dc:creator></item><item><title>RE: Odd ThemedSplitContainer Behavior</title><link>http://forum.strataframe.net/FindPost20609.aspx</link><description>Just add a test that if the WIdth is &amp;lt;= 0 then bail...there is nothing to render.</description><pubDate>Fri, 07 Nov 2008 09:23:35 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Odd ThemedSplitContainer Behavior</title><link>http://forum.strataframe.net/FindPost20606.aspx</link><description>I added the Try-Catch block as&amp;nbsp;Trent suggested.&amp;nbsp; The form is behaving better.&amp;nbsp; Since the try-catch block basically is doing nothing but bypassing the bad code, may I ask what is the code supposed to be doing?&amp;nbsp; Just trying to understand why things work the way they do.&lt;/P&gt;&lt;P&gt;[codesnippet]&lt;BR&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;Private&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;Sub&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; RenderHorizontalBar(&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;ByVal&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; DrawObj &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;As&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; Graphics)&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=#008000 size=2&gt;&lt;FONT color=#008000 size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; '-- Establish Locals&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Try&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;Dim&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; loRect &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;As&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;New&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; Rectangle(0, &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;Me&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;.SplitterDistance, &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;Me&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;.Width, &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;Me&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;.SplitterWidth)&amp;nbsp; &lt;FONT color=#ff1111&gt;&lt;STRONG&gt;&amp;lt;---this is the line that bombs,&amp;nbsp;Me.Width = 0&lt;BR&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;Dim&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; loBar &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;As&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;New&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; LinearGradientBrush(loRect, _DrawGradientBegin, _DrawGradientEnd, _DrawHorizontalGradientDirection)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [&amp;nbsp;CODE SNIPPED ]&lt;BR&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Catch&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; ex &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;As&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; Exception&lt;/P&gt;&lt;P&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; End&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;Try&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;End&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; &lt;/FONT&gt;&lt;FONT color=#0000ff size=2&gt;&lt;FONT color=#0000ff size=2&gt;Sub&lt;BR&gt;&lt;/FONT&gt;&lt;/FONT&gt;[/codesnippet]&lt;/P&gt;&lt;P&gt;Thanks!&lt;BR&gt;Bill</description><pubDate>Fri, 07 Nov 2008 07:02:09 GMT</pubDate><dc:creator>Bill Cunnien</dc:creator></item><item><title>RE: Odd ThemedSplitContainer Behavior</title><link>http://forum.strataframe.net/FindPost20600.aspx</link><description>What version are you using when you run the project?</description><pubDate>Thu, 06 Nov 2008 13:20:28 GMT</pubDate><dc:creator>Bill Cunnien</dc:creator></item><item><title>RE: Odd ThemedSplitContainer Behavior</title><link>http://forum.strataframe.net/FindPost20591.aspx</link><description>I'm sorry, but I cannot reproduce this which means that it has already been addressed.&amp;nbsp; I am not sure if the most recently posted beta has this in it or not at this point, I will have to research when this was fixed, whic to be honest, I think was a while back.&amp;nbsp; But in any case, it would require an update of your assemblies.&amp;nbsp; Here would be my suggestion for your immediate resolution, just open the SF source, and in teh OnPaint, place a Try/Catch around the entire OnPaint.&amp;nbsp; We actually fixed this differently, but this will resolve your problem and get you going down your current path.&lt;/P&gt;&lt;P&gt;The next SF beta will be a bigger update because all of the BO partial classes will have to be rebuilt as the property type descriptors are different (for the better) now.&amp;nbsp; So in any case, you will probably just wnt to fix what you have since you are in the middle of testing (from what I gather).</description><pubDate>Thu, 06 Nov 2008 09:30:17 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Odd ThemedSplitContainer Behavior</title><link>http://forum.strataframe.net/FindPost20583.aspx</link><description>Thanks, Ivan.&amp;nbsp; Not urgent, but the window is already well into the testing phase, so to restructure it would be a big task.&amp;nbsp; For now, the users have been instructed that the workaround is to simply not minimize that &amp;#119;indow.&amp;nbsp; Not the best workaround from a user standpoint, but knowing the Strataframe gurus, it will not be long before they have a fix prepared.</description><pubDate>Thu, 06 Nov 2008 07:18:54 GMT</pubDate><dc:creator>Bill Cunnien</dc:creator></item><item><title>RE: Odd ThemedSplitContainer Behavior</title><link>http://forum.strataframe.net/FindPost20571.aspx</link><description>Hey Bill.&lt;/P&gt;&lt;P&gt;I tested over here and got the error. It looks like a problem with a the TabControl, when you Dock the SplitContainer to it. Without a TabControl, it works fine docked. With a TabControl, it works fine undocked. So, if it is urgent, you could try one of these scenarios.</description><pubDate>Wed, 05 Nov 2008 16:07:48 GMT</pubDate><dc:creator>Ivan George Borges</dc:creator></item><item><title>RE: Odd ThemedSplitContainer Behavior</title><link>http://forum.strataframe.net/FindPost20569.aspx</link><description>Run the app, minimize the form, then restore the form.&amp;nbsp; The app fails on two different systems in our office, so I am not suspecting a local environment problem.&amp;nbsp; I'd rather not update to the beta unless I have to.&amp;nbsp; Are you unable to reproduce the behavior, still?</description><pubDate>Wed, 05 Nov 2008 15:12:21 GMT</pubDate><dc:creator>Bill Cunnien</dc:creator></item><item><title>RE: Odd ThemedSplitContainer Behavior</title><link>http://forum.strataframe.net/FindPost20567.aspx</link><description>How do you reproduce the error with your sample?&amp;nbsp; It is not failing, so I am guessing that your assemblies are not up to date.&amp;nbsp; If I need to do something to force the error, then please let me know.&amp;nbsp; Thanks.</description><pubDate>Wed, 05 Nov 2008 12:57:18 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Odd ThemedSplitContainer Behavior</title><link>http://forum.strataframe.net/FindPost20566.aspx</link><description>here's the sample</description><pubDate>Wed, 05 Nov 2008 11:41:59 GMT</pubDate><dc:creator>Bill Cunnien</dc:creator></item><item><title>RE: Odd ThemedSplitContainer Behavior</title><link>http://forum.strataframe.net/FindPost20560.aspx</link><description>How are you producing this error.&amp;nbsp; I can see the stack trace, but this is a control that has extensive use and is something that we use ourselves extensively.&amp;nbsp; We had our QA department turn in an issue a while back where the panel size was becoming 0 in width or height and produced an error.&amp;nbsp; This has since been fixed.&amp;nbsp; So you are welcome to post a sample so we can make sure that you are just not using up to date assemblies or that there is not an issue elsewhere.&amp;nbsp; That would probably be the best avenue to travel.&amp;nbsp; Just like anything else, if we see it in a reproducable state, you are going to get answers much faster since we will be able to trace and see the point of failure.&amp;nbsp;Thanks.</description><pubDate>Wed, 05 Nov 2008 10:07:12 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: Odd ThemedSplitContainer Behavior</title><link>http://forum.strataframe.net/FindPost20558.aspx</link><description>I am using the most current, non-Beta version.</description><pubDate>Wed, 05 Nov 2008 09:55:47 GMT</pubDate><dc:creator>Bill Cunnien</dc:creator></item><item><title>RE: Odd ThemedSplitContainer Behavior</title><link>http://forum.strataframe.net/FindPost20557.aspx</link><description>The first thing to do is to ensure you are on the latest version of the software. There was a similar issue we fixed a couple of versions ago that may be manifesting in the way you are describing. If you update to the latest version and still experience the behavior we'll take a closer look at it, but I don't think there is an issue here.</description><pubDate>Wed, 05 Nov 2008 09:29:42 GMT</pubDate><dc:creator>Dustin Taylor</dc:creator></item></channel></rss>