When is Panel.Size updated after adding controls when Panel.AutoSize = true?
问题 I'm creating a GUI in C# using WinForms . I'm trying to position programaticaly created panels one below the other. As the content of these panel can vary depending on their content, I'm using Panel.AutoSize to let WinForms perform the correct resizing. The problem is: if I'm using Panel.Height (or Panel.Size.Height ) right after populating the Panel , the value returned is always my default value. The resizing do occur, as I can see when launching the app, but I just don't know when. Here's