Modifying WinForm UserControl at runtime

jsparks228 6 Reputation points
2023-03-01T19:22:35.3+00:00

I have a UserControl (ResultContainerPanel) that at runtime I am trying to add a second UserControl (Result) to. The Code works and I see the Result objects that I am placing in ResultContainerPanel.Control, but the Result objects are not keeping their location. It looks like they are stacking on top of one another. I have viewed the Location of the objects and they seem to be correct.

User's image

This is the user control ResultContainerPanel

User's image

This is the user control Result

User's image

This is the result off adding 3 Result objects at runtime. There are 3 controls in the ResultContainerPanel with varying locations, but it appears that all three stack on top of each other.

User's image

Struggling to understand, any help would be greatly appreciated.

Windows Forms
Windows Forms
A set of .NET Framework managed libraries for developing graphical user interfaces.
1,866 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,535 questions
{count} votes