When playing with WPF, I discovered the SizeToContent method, which enables me to create dynamically the content of a window, and then have it automatically resized to fit its content.
I try to do the same thing using WinForms, and it fails.
I used the AutoSize and AutoSizeMode, but it fails to correctly size to its content.
Is there a way to create a WinForm with controls that adjust to the size of their content, as in WPF?
Thanks,
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…