Solved

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

Posted on 2014-10-09
4
690 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

762 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

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now