Make textbox fill up and resizie
-
Hi! Sorry for weird subject but was a bit unsure on what to call it. Anyway, I have a WPF-form where I have some items below a textbox. I want the textbox to fill up the grid above the bottom controls but leave space for them.
Sounds like you want a
DockPanel
instead of aGrid
. DockPanel Class (System.Windows.Controls) | Microsoft Docs[^] How to: Choose Between StackPanel and DockPanel - WPF .NET Framework | Microsoft Docs[^]
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
-
Hi! Sorry for weird subject but was a bit unsure on what to call it. Anyway, I have a WPF-form where I have some items below a textbox. I want the textbox to fill up the grid above the bottom controls but leave space for them.
When you put Grids in a StackPanel, the Grids "lose" their "star" (*) qualities since StackPanel do not fill available space. You should put your Grids in a parent Grid instead of a StackPanel (if you want to make the most of "stretching"). I typically start everything with "*" or Auto; only afterwards do I (rarely) touch up with explicit widths or heights.
It was only in wine that he laid down no limit for himself, but he did not allow himself to be confused by it. ― Confucian Analects: Rules of Confucius about his food