namespace VoiceCat.App.Forms; /// /// A small reusable modal that prompts for a single line of text (e.g., kick/ban reason). /// Returns DialogResult.OK with Text set, or DialogResult.Cancel. /// public sealed class InputDialog : Form { private readonly TextBox _txtInput; public string TextValue => _txtInput.Text.Trim(); public InputDialog(string caption, string label, string defaultText = "") { var lbl = new Label { Text = label, AutoSize = true, Location = new Point(12, 12), TabIndex = 0, }; _txtInput = new TextBox { Text = defaultText, Location = new Point(12, 36), Size = new Size(360, 23), TabIndex = 1, }; var btnOk = new Button { Text = "&OK", DialogResult = DialogResult.OK, Location = new Point(216, 72), Size = new Size(75, 27), TabIndex = 2, }; var btnCancel = new Button { Text = "&Cancel", DialogResult = DialogResult.Cancel, Location = new Point(297, 72), Size = new Size(75, 27), TabIndex = 3, }; AcceptButton = btnOk; CancelButton = btnCancel; AutoScaleMode = AutoScaleMode.Font; ClientSize = new Size(384, 112); Controls.AddRange([lbl, _txtInput, btnOk, btnCancel]); FormBorderStyle = FormBorderStyle.FixedDialog; MaximizeBox = false; MinimizeBox = false; StartPosition = FormStartPosition.CenterParent; Text = caption; } }