Skip to content

Commit

Permalink
Small code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
mscrivo committed Jun 11, 2023
1 parent 1fcb6df commit 642bcc1
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions OotD.Core/Forms/InputBox.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,12 @@ private void OkButton_Click(object sender, EventArgs e)
/// <returns></returns>
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();

Expand Down Expand Up @@ -91,4 +89,4 @@ private void InputTextBox_Validating(object sender, CancelEventArgs e)
e.Cancel = true;
_errorProviderText.SetError(InputTextBox, args.Message);
}
}
}

0 comments on commit 642bcc1

Please sign in to comment.