2
using System.Collections.Generic;
4
using System.Windows.Forms;
8
namespace StructuredStorageExplorer
12
public static DialogResult InputBox(string title, string promptText, ref string value)
14
Form form = new Form();
15
Label label = new Label();
16
TextBox textBox = new TextBox();
17
Button buttonOk = new Button();
18
Button buttonCancel = new Button();
21
label.Text = promptText;
25
buttonCancel.Text = "Cancel";
26
buttonOk.DialogResult = DialogResult.OK;
27
buttonCancel.DialogResult = DialogResult.Cancel;
29
label.SetBounds(9, 20, 372, 13);
30
textBox.SetBounds(12, 36, 372, 20);
31
buttonOk.SetBounds(228, 72, 75, 23);
32
buttonCancel.SetBounds(309, 72, 75, 23);
34
label.AutoSize = true;
35
textBox.Anchor = textBox.Anchor | AnchorStyles.Right;
36
buttonOk.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
37
buttonCancel.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
39
form.ClientSize = new Size(396, 107);
40
form.Controls.AddRange(new Control[] { label, textBox, buttonOk, buttonCancel });
41
form.ClientSize = new Size(Math.Max(300, label.Right + 10), form.ClientSize.Height);
42
form.FormBorderStyle = FormBorderStyle.FixedDialog;
43
form.StartPosition = FormStartPosition.CenterScreen;
44
form.MinimizeBox = false;
45
form.MaximizeBox = false;
46
form.AcceptButton = buttonOk;
47
form.CancelButton = buttonCancel;
49
DialogResult dialogResult = form.ShowDialog();
54
public static bool IsStreamTreeNode(TreeNode node)
56
return ((CFItem)node.Tag).IsStream;