A set of .NET Framework managed libraries for developing graphical user interfaces.
Hello @Researcher ,
Thank you for the detailed report and the thorough troubleshooting steps you have already attempted.
Based on observed behavior reported across the community, the error seems to be triggered by the WinForms Designer's serialization process. When a control's layout is modified inside a TableLayoutPanel, the Designer re-serializes the layout state, and at some point, during this process, Int32.MinValue (-2147483648) appears to be passed as the RowPosition value. It is worth noting that commenting out set_RowPosition in the .Designer.vb file did not resolve the issue in your case, which may suggest the value originates from somewhere beyond the Designer-generated code, though the exact internal mechanism is not officially documented by Microsoft.
I attempted to reproduce this in my own environment using Visual Studio 2022 Enterprise on Windows 11 24H2, with a VB.NET Windows Forms Application targeting .NET Framework 4.6, 4.7.2, and 4.8, but was unable to reproduce the error on any of those versions. I was unable to test on .NET Framework 4.0 directly due to compatibility limitations, so I cannot confirm whether the issue is specific to that version. Below are screenshots from my reproduction attempt.
The first shows the initial run with the original layout:
The second shows a subsequent run after deliberately dragging and rearranging controls within the TableLayoutPanel:
In both cases, the application launched without any error dialogs.
Regarding your question about a permanent resolution, based on community reports and my own testing, there does not appear to be a known permanent fix that keeps .NET Framework 4.0 and the Designer workflow intact. The most viable path to permanently eliminating this issue would be upgrading the target framework to.NET Framework 4.8, as I was unable to reproduce the error on any of the higher framework versions I tested. Since .NET Framework 4.0 is no longer officially supported by Microsoft, this may also be worth considering from a long-term maintenance perspective.
I hope this helps. Please let me know if you have any additional details that might help narrow down the cause further. If my explanation and the information I provided were helpful, I would greatly appreciate it if you could follow the instructions here so others with the same problem can benefit as well.
Thank you.