Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2014-10-09
4
Medium Priority
?
788 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 1200 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 800 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

Create CentOS 7 Newton Packstack Running Keystone

A bug was filed against RDO for the installation of Keystone v3. This guide is designed to walk you through the configuration for using Keystone v3 with Packstack. You will accomplish this using various repos and the Answers file.

Question has a verified solution.

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

This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …

715 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