diff --git a/Terminal.Gui/Views/Dialog.cs b/Terminal.Gui/Views/Dialog.cs index 1d0aa8cd4..a7771c9a6 100644 --- a/Terminal.Gui/Views/Dialog.cs +++ b/Terminal.Gui/Views/Dialog.cs @@ -184,9 +184,12 @@ public class Dialog : Window // Find the maximum button height var maxHeight = 1; // Default to minimum height of 1 for buttons - foreach (Button button in _buttons.Where (b => b.Frame.Height > maxHeight)) + foreach (Button button in _buttons) { - maxHeight = button.Frame.Height; + if (button.Frame.Height > maxHeight) + { + maxHeight = button.Frame.Height; + } } // Set the bottom padding to match button height