Solved

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

Posted on 2014-10-09
4
738 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 34

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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
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
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

749 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