InputBox

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello
Is there a standard inputbox in the .Net framework (usable for C#), just like a modal MessageBox except it prompts for a string? I know that VB had an InputBox( ) method, but I don't see an equivalent, nor do I see how to modify the MessageBox to make it an InputBox. The ideal would be something like

string strResult = InputBox("Message here")
//strResult set to whatever the user typed

I could always just write my own inputbox form, but that's a lot of extra work for something that should be basic

Thanks
Mike
 
Add a reference to the Microsoft Visual Basic .NET Runtime and then the
following code will work:

string s = Microsoft.VisualBasic.Interaction.InputBox("x","y","z",0,0);

Microsoft.VisualBasic.Interaction.MsgBox(s,Microsoft.VisualBasic.MsgBoxStyle
..OKCancel,"Test");


--
Marc Butenko
(e-mail address removed)



Mike said:
Hello,
Is there a standard inputbox in the .Net framework (usable for C#), just
like a modal MessageBox except it prompts for a string? I know that VB had
an InputBox( ) method, but I don't see an equivalent, nor do I see how to
modify the MessageBox to make it an InputBox. The ideal would be something
like:
string strResult = InputBox("Message here");
//strResult set to whatever the user typed.

I could always just write my own inputbox form, but that's a lot of extra
work for something that should be basic.
 
Back
Top