Home Dashboard Directory Help

System.Windows.Forms.TableLayoutPanel Behavior Change .NET 4.5 Framework by joncloud.sprbrk



Sign in
to vote
Type: Bug
ID: 767282
Opened: 10/12/2012 5:52:12 PM
Access Restriction: Public
User(s) can reproduce this bug


The behavior when adding controls to a System.Windows.Forms.TableLayoutPanel differs with .NET Framework 4.5. The attached code when compiled for 2.0, and 4.5 (or 4.0 when 4.5 is installed) displays that the order the controls are displayed is inconsistent. Also the attached screenshots show visual the difference.
Sign in to post a comment.
Posted by Microsoft on 12/3/2012 at 9:45 AM
We’re working on a broad update on a priority basis. We’re unable to communicate public date yet. If you need something immediately, you can contact us for hotfix. Just follow the regular process of opening a support case. Easier option would be to file online https://support.microsoft.com/oas/default.aspx?&gprid=548&&st=1&wfxredirect=1&sd=gn or call support http://support.microsoft.com/default.aspx?id=fh;en-us;offerprophone. You will need to pay upfront but you may get refund based on customer support policies.
Thank you,
.NET Framework Product Team

Posted by joncloud.sprbrk on 11/28/2012 at 6:58 AM
Is there any more of a concrete time frame for the release of this correction? We are trying to determine whether or not we can wait for the release of the correction or if we need to correct the issue prior to.
Posted by Microsoft on 11/15/2012 at 1:22 PM
We are planning to ship this fix in the upcoming update to .NET Framework 4.5 in the next couple of months. If you apply the suggested workaround, this workaround will be still valid after we ship the fix.

Thank you,
The Windows Forms Product Team
Posted by Microsoft on 10/15/2012 at 6:25 PM
Thank you for your feedback. We are able to reproduce this issue and are considered fixing the issue in our next release.

To work around the issue you can try setting different explicit cell coordinates for each control. Something like that will behave determinstically and will not be a subject of undefined behavior:

            // Red Panel should be on the right.
            panel.Controls.Add(new Panel { BackColor = Color.Red, Dock = DockStyle.Fill }, 1, 0);

            // Green Panel should be on the left.
            panel.Controls.Add(new Panel { BackColor = Color.Green, Dock = DockStyle.Fill }, 0, 0);

Many customers have found it useful to discuss issues like this in the forums (http://www.microsoft.com/communities/forums/default.mspx) where Microsoft and other members of the community can suggest workarounds. Please keep the feedback coming.

The Windows Forms Team
Posted by Microsoft on 10/15/2012 at 12:34 AM
Thank you for submitting feedback on Visual Studio and .NET Framework. Your issue has been reproduced and has been routed to the appropriate VS development team for review. We will contact you if we require any additional information.
Posted by Microsoft on 10/12/2012 at 6:51 PM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(http://support.microsoft.com)
Sign in to post a workaround.
Posted by TanyaSolyanik on 11/28/2012 at 12:26 PM
As a workaround, avoid placing controls into the same cell in your TableLayoutPanel. Additional advantage to this approach is a performance improvement when the form(or control) is loaded.
File Name Submitted By Submitted On File Size  
NET4.5.png 10/12/2012 22 KB
NET2.0.png 10/12/2012 15 KB
Program.cs 10/12/2012 943 bytes