473,385 Members | 1,748 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

InputBox

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);
}

namesListBox is a ListBox in the main window of my application.

This code generates an error:

[C# Error] WinForm.cs(103): The name InputBox doesn't exist in the class or
namespace Test.WinForm

Hans Kamp.

Nov 15 '05 #1
1 3374

"William Ryan" <do********@comcast.nospam.net> schreef in bericht
news:04****************************@phx.gbl...

do********@comcast.nospam.net
www.knowdotnet.com
-----Original Message-----
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);
}

namesListBox is a ListBox in the main window of my

application.

This code generates an error:

[C# Error] WinForm.cs(103): The name InputBox doesn't

exist in the class or
namespace Test.WinForm

There isn't one native in C#, but this guy made one (you
could make your own easy enough).


I have also made one myself. It is much like the InputBox from VB and VBA,
but mine is a class with some properties (so by using getters and setters).
This class is derived from a Dialog Box form.

I am quite an explorer right now, that is quickly discovering the secrets of
C# en C#Builder.

Hans Kamp.
Nov 15 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Ed K | last post by:
Hi, I'm new to vb.net and learning with the book "Visual Basic.Net Step By Step. In chapter 5 it gives an example of using an inputbox. however when I try to do it the way it shows, I get the...
2
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
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...
1
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
by: portroe | last post by:
How can you populate an array using an inputbox(es)? thanks portroe
3
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...
8
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...
2
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...
8
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...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.