I’m in the process of learning WPF and I have a problem with a groupbox (without a height and width specified) taking up more space on the form than it needs.
From researching a few other posts on here (such as this) I know that controls like groupboxes will expand to fill their container.
Is there a way of specifying in WPF that you’d like the form to automatically size to fit all of its components based on a total of their individual sizes? It seems a bit odd that if I’m using DockPanels that size to fit their components that the main window needs to be told the correct height and width.
You can set
SizeToContenttoWidthAndHeighton the window.