From 642bcc1493649c823dd4de97ba5c33afa22b87cc Mon Sep 17 00:00:00 2001 From: Michael Scrivo Date: Sun, 11 Jun 2023 11:24:33 -0400 Subject: [PATCH] Small code cleanup --- OotD.Core/Forms/InputBox.cs | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/OotD.Core/Forms/InputBox.cs b/OotD.Core/Forms/InputBox.cs index cf20782..66fb8ed 100644 --- a/OotD.Core/Forms/InputBox.cs +++ b/OotD.Core/Forms/InputBox.cs @@ -47,14 +47,12 @@ private void OkButton_Click(object sender, EventArgs e) /// public static InputBoxResult Show(Form owner, string instructions, string caption, string defaultValue, InputBoxValidatingEventHandler validator) { - using var form = new InputBox - { - Owner = owner, - PromptLabel = { Text = instructions }, - Text = caption, - InputTextBox = { Text = defaultValue }, - Validator = validator - }; + using var form = new InputBox(); + form.Owner = owner; + form.PromptLabel.Text = instructions; + form.Text = caption; + form.InputTextBox.Text = defaultValue; + form.Validator = validator; var result = form.ShowDialog(); @@ -91,4 +89,4 @@ private void InputTextBox_Validating(object sender, CancelEventArgs e) e.Cancel = true; _errorProviderText.SetError(InputTextBox, args.Message); } -} \ No newline at end of file +}