which class for InputBox

  • Thread starter Thread starter Enosh Chang
  • Start date Start date
E

Enosh Chang

Hi all,

I used InputBox for input in VB6. Which class I can use in .Net? Thanks!

Best Regards
 
You may need to add a reference to Microsoft.Visual Basic .NET Runtime (in
MicrosoftVisualBasic.dll). If you create a new Windows Forms project in VB
(I'm using VS03 so I can't speak for VS02) it'll just be there.
 
i use c#, and i add reference of MicrosoftVisualBasic.dll
but i can't find InputBox method
 
Hi,

In C# you have to add a reference to "Microsoft.Visual Basic .NET Runtime"
and use something like this (remember to add "using Microsoft.VisualBasic;"
at the top of your source):

string s = Interaction.InputBox( "Enter your text:", "" , "default
text", -1, -1 );

Unlike Visual Basic where every parameter except the prompt are optional, in
C# you have to specify them.

Regards,

Gabriele
 
Back
Top