diff --git a/UICatalog/Scenarios/Dialogs.cs b/UICatalog/Scenarios/Dialogs.cs index a7ef21d3b..a880562f8 100644 --- a/UICatalog/Scenarios/Dialogs.cs +++ b/UICatalog/Scenarios/Dialogs.cs @@ -15,6 +15,7 @@ namespace UICatalog.Scenarios { X = Pos.Center (), Y = 1, Width = Dim.Percent (75), + Height = Dim.AutoSize () }; var label = new Label ("Width:") { @@ -114,20 +115,6 @@ namespace UICatalog.Scenarios { }; frame.Add (styleRadioGroup); - frame.ForceValidatePosDim = true; - void Top_Loaded (object sender, EventArgs args) - { - frame.Height = - widthEdit.Frame.Height + - heightEdit.Frame.Height + - titleEdit.Frame.Height + - numButtonsEdit.Frame.Height + - glyphsNotWords.Frame.Height + - styleRadioGroup.Frame.Height; - Application.Top.Loaded -= Top_Loaded; - } - Application.Top.Loaded += Top_Loaded; - Win.Add (frame); label = new Label ("Button Pressed:") { diff --git a/UICatalog/Scenarios/MessageBoxes.cs b/UICatalog/Scenarios/MessageBoxes.cs index a92f30f11..95be053e8 100644 --- a/UICatalog/Scenarios/MessageBoxes.cs +++ b/UICatalog/Scenarios/MessageBoxes.cs @@ -14,7 +14,7 @@ namespace UICatalog.Scenarios { X = Pos.Center (), Y = 1, Width = Dim.Percent (75), - Height = 12 + Height = Dim.AutoSize () }; Win.Add (frame); @@ -145,24 +145,7 @@ namespace UICatalog.Scenarios { Y = Pos.Top (label) + 3 }; frame.Add (ckbWrapMessage); - - frame.ForceValidatePosDim = true; - void Top_Loaded (object sender, EventArgs args) - { - frame.Height = - widthEdit.Frame.Height + - heightEdit.Frame.Height + - titleEdit.Frame.Height + - messageEdit.Frame.Height + - numButtonsEdit.Frame.Height + - defaultButtonEdit.Frame.Height + - styleRadioGroup.Frame.Height + - 2 + - ckbWrapMessage.Frame.Height; - Application.Top.Loaded -= Top_Loaded; - } - //Application.Top.Loaded += Top_Loaded; - + label = new Label ("Button Pressed:") { X = Pos.Center (), Y = Pos.Bottom (frame) + 4,