What is the C# version of VB.net's InputDialog?

wusher picture wusher · Sep 18, 2008 · Viewed 216.8k times · Source

What is the C# version of VB.net's InputBox?

Answer

Ozgur Ozcitak picture Ozgur Ozcitak · Sep 18, 2008

Add a reference to Microsoft.VisualBasic, InputBox is in the Microsoft.VisualBasic.Interaction namespace:

using Microsoft.VisualBasic;
string input = Interaction.InputBox("Prompt", "Title", "Default", x_coordinate, y_coordinate);

Only the first argument for prompt is mandatory