string value = "Document 1"; if (Tmp.InputBox("New document", "New document name:", ref value) == DialogResult.OK) { myDocument.Name = value; }