473,612 Members | 2,094 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Inputbox In C#

1 New Member
Hi!
I want to prompt the user an inoput box and get the result in a variable
I know how to do this in VB but how do i do it in c#.

Regards,
SREEDHAR CHOUDARY
Dec 18 '07 #1
1 1868
Plater
7,872 Recognized Expert Expert
Is this for a windows application or web application?
For the most part.NET did away with the inputbox.
You will need to create your own form/dialog for it.

If you really want to try and use it (not recomended):
Add this namespace:
Namespace: Microsoft.Visua lBasic

And be sure to add this dll to the references
Assembly: Microsoft.Visua lBasic (in microsoft.visua lbasic.dll)
Dec 18 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
2140
by: news.microsoft.com | last post by:
hey all, I am having an odd problem with the InputBox in VB.NET, and it ONLY happens on one of my computers. When I try "Dim x as String = InputBox("TESTPROMPT"), I get the following error: ---------------------------------------------------------------------------- ---- ---------------------------------------------------------------------------- ----
2
3296
by: missimaths | last post by:
I was wondering if anyone knew of a way to control the text a user types into an inputbox? I want the user to type in four letters only. I can check the lenght by using the len() function in vba but I have no idea how to check that each character is a letter. I realise I could design a form to do this, but if the check could be done on an inputbox, it would be so much easier. Thanks in advance.
1
3392
by: Hans Kamp | last post by:
How do I use InputBox? private void addButton_Click(object sender, System.EventArgs e) { string newName; newName = InputBox("t1", "t2", "t3"); namesListBox.Items.Add(newName); }
1
1834
by: | last post by:
When trying to use the InputBox function I get the error "InputBox is a namespace and therefore is not a valid expression". Can anyone tell me what the problem is? Thanks.
7
13794
by: portroe | last post by:
How can you populate an array using an inputbox(es)? thanks portroe
3
1441
by: jcrouse | last post by:
Here is my code: Private Sub cmP1JoyUpLabelSize_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmP1JoyUpLabelSize.Click lblP1JoyUp.Width = InputBox("Enter the Width of the label.") lblP1JoyUp.Height = InputBox("Enter the Height of the label.") End Sub After the box pops up how do I allow the user to back out without entering and data. It errors out if the input field is left empty or if the cancel button is...
8
6047
by: about:mozilla | last post by:
I'm just a newbie in vb.net and I have this terrible problem. I want to use inputbox to get number. -User can give numbers starting from 0 -If cancel is pressed then default number stays -If text is given then messagebox gives error Thanks in advance... Newbie
2
1814
by: MLH | last post by:
HowManyMore = InputBox(MyString, "How Many More?", "3") The above line results in an InputBox displaying that has an X button in the upper right corner. And next to it, there's a ? button (for help, I suppose). In addition to the question posed by MyString, there are 2 more buttons: an OK button and a Cancel button. I would like to have NOTHING but the OK button. Can I do that with InputBox in A97?
8
1639
by: jpoquette | last post by:
I have recently upgraded a Visual Basic 2003 win forms application to 2005. After doing so I can no longer get my project to compile. The code is bombing on any line that uses an InputBox. I'm getting a MissingManifestResourceException unhandled Exception. I've read several postings and tried various things, but I can not get anything to work. I've also created a new 2005 project from scratch, added an InputBox in code, and I still...
0
1367
by: insight_find | last post by:
I would like to check the user input into an inputbox in vb.net 2003. The inputbox in my program assigns the input from the inputbox into an array called get_grades which takes in students grades as in.. A.. B.. C...D...F. My question is how could I check the user input to make sure its within that range.. A..B...C...D...F? and if not use a messagebox to say " Please enter a letter grade from....."
0
8159
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8602
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8245
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8415
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6074
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5530
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4044
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
1694
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1413
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.