Lifestyle, hobbies, work, rage…
I miss Visual Basic
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…
| Print article | This entry was posted by Boris on August 19, 2007 at 6:03 pm, and is filed under C#, Programming. Follow any responses to this post through RSS 2.0. You can leave a response or trackback from your own site. |