Solved

vb.net or c#, InputBox to get user value ("abc", "123", etc.

Posted on 2014-10-09
4
711 Views
Last Modified: 2014-10-24
I found some sample code for inputbox but they mainly relate to inputs in form of what button a user clicks.

Question: How can I code to get user input by prompting the user a text box to enter her/his choice like "ABC", "123", etc?

Are there such control or I have to use another form using Friend scope instead?
0
Comment
Question by:Mike Eghtebas
4 Comments
 
LVL 22

Expert Comment

by:Mrunal
ID: 40370782
have you used "InputBox Function" ?

here is reference:

http://msdn.microsoft.com/en-us/library/6z0ak68w%28v=vs.90%29.aspx
0
 
LVL 33

Author Comment

by:Mike Eghtebas
ID: 40371317
re:  have you used "InputBox Function" ?

Yes I have. That is why I started my question saying: "I found some sample code for inputbox but they mainly relate to inputs in form of what button a user clicks."
0
 
LVL 40

Accepted Solution

by:
Jacques Bourgeois (James Burger) earned 300 total points
ID: 40372238
Are you in C# or in VB.

The InputBox function is not a Framework function. It exists only in the Microsoft.Visual.Basic namespace to mimick the same function as it existed in VB6. So it is available only in VB. What it does is exactly what you want: present a TextBox to the user for some input, and return you the value.

There is no equivalent in C#, where you need to design your own form to do something similar, but it is a gain since you can do anything in it. If you have seen something about InputBox in C#, it is simply somebody who designed a form and gave it that name. If you create you own, you will not be limited in anyway with what it can do.
0
 
LVL 11

Assisted Solution

by:louisfr
louisfr earned 200 total points
ID: 40372961
Any Function available to VB is available to C#.
If you want to use the Microsoft.VisualBasic.Interaction.InputBox method, you only need to add Microsoft.VisualBasic.dll to the references of your project.
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Jquery/JSON passing value from one function to another 12 35
C# bracket error 3 30
Batch file or script with password 22 39
Sql server insert 13 27
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

786 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question