I stopped using VB about 6 years ago, after VB6 was launched. Having since moved to PHP/Perl/C# and such, I miss one of its functions. Sure, VB programmers are spoiled – everything’s coded in. What I can’t understand is why VB.NET has an InputBox and C# doesn’t.

Anyway… this code snippet should help. I know this is available through Google, but I wanted to have it here for the hell of it.

Once you have added a reference to Microsoft.VisualBasic.dll (Solution Explorer -> Add Reference -> .NET -> Microsoft.VisualBasic), you can just call it this way:

String result = Microsoft.VisualBasic.Interaction.InputBox(Prompt, Title, Default, XPos, YPos);

It sure comes in handy when you don’t want to create a whole new form just for user interaction…