Alex Rivera | Logout

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

Asked 2008-09-18T21:20:05.963
182

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

Edit
Report

2 Answers

276

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

answered 2008-09-18T21:25:56.480
3

You mean InputBox? Just look in the Microsoft.VisualBasic namespace.

C# and VB.Net share a common library. If one language can use it, so can the other.

answered 2008-09-18T21:22:51.433

Your Answer