473,385 Members | 1,958 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.

TextBox/ForLoop Help

If anyone could help, I would greatly appreciated.

I am using a "For Loop" and thru each complete iteration I would like it to
stop and ask for user input, but I would not like to use a MessageBox.
Instead, I would like to use a Textbox. Is there a way for me to accomplish
this? Thanks in advance!

Claude
May 2 '07 #1
5 1813

class MyUserInpurForm : Form { ....
TextBox textBox ....
}

MyUserInpurForm userInput = new MyUserInpurForm();
userInpur.ShowDialog();

The .ShowDialog will be wait until the form is closed.

Alex
http://devkids.blogspot.com
If anyone could help, I would greatly appreciated.

I am using a "For Loop" and thru each complete iteration I would like
it to stop and ask for user input, but I would not like to use a
MessageBox. Instead, I would like to use a Textbox. Is there a way for
me to accomplish this? Thanks in advance!

Claude

May 2 '07 #2
I'm assuming you are using Windows/WinForms and not web?

If so, you would need to put the text box on a form, then on the form you
could use the ShowDialog method of the form. When you call
[formnamehere].ShowDialog(... processing will stop in your loop until the
Hide or Close method of the form is called. Assuming you also had an OK
button on the form, in it's stuff the text box's text property into a new
property for the form, then call this.Hide. That way back in the loop you
can call the [formnamehere].mynewpropertyname to get what the user keyed in,
then [formnamehere].Close to close it.

I have to say though, calling a dialog box like that over and over is going
to make for a really bad user experience. You need to seriously rethink
this, and see if there's a better way to implement the interface. I know if
I were a user I wouldn't be happy about having this dialog pop up over and
over demanding info.

Robert
http://arcanecode.com

"Claude Grecea" <cg*****@shionogi-usa.comwrote in message
news:Oj**************@TK2MSFTNGP05.phx.gbl...
If anyone could help, I would greatly appreciated.

I am using a "For Loop" and thru each complete iteration I would like it
to stop and ask for user input, but I would not like to use a MessageBox.
Instead, I would like to use a Textbox. Is there a way for me to
accomplish this? Thanks in advance!

Claude
May 2 '07 #3
Yes, I am using a "WindowsForm", but I would not like to call a Dialog
because of same issue. What I would like to happen is every time the "For
Loop" goes thru each iteration to stop and wait for user input in the
"TextBox". Is there a method to call for this particular situation?

Claude
"Arcane Code" <ar********@gmail.comwrote in message
news:u4**************@TK2MSFTNGP02.phx.gbl...
I'm assuming you are using Windows/WinForms and not web?

If so, you would need to put the text box on a form, then on the form you
could use the ShowDialog method of the form. When you call
[formnamehere].ShowDialog(... processing will stop in your loop until the
Hide or Close method of the form is called. Assuming you also had an OK
button on the form, in it's stuff the text box's text property into a new
property for the form, then call this.Hide. That way back in the loop you
can call the [formnamehere].mynewpropertyname to get what the user keyed
in, then [formnamehere].Close to close it.

I have to say though, calling a dialog box like that over and over is
going to make for a really bad user experience. You need to seriously
rethink this, and see if there's a better way to implement the interface.
I know if I were a user I wouldn't be happy about having this dialog pop
up over and over demanding info.

Robert
http://arcanecode.com

"Claude Grecea" <cg*****@shionogi-usa.comwrote in message
news:Oj**************@TK2MSFTNGP05.phx.gbl...
>If anyone could help, I would greatly appreciated.

I am using a "For Loop" and thru each complete iteration I would like it
to stop and ask for user input, but I would not like to use a MessageBox.
Instead, I would like to use a Textbox. Is there a way for me to
accomplish this? Thanks in advance!

Claude

May 2 '07 #4
Nope.

Text boxes must exist in something, that's what the forms are for.

You can, however, minimize the impact of the form by removing it's borders,
caption, etc, and making the text box take up 100% of the interior of the
form. Then it will LOOK like it's just a text box, but in fact be a text box
inside a form. That's the only way I know of for you to achieve the look you
want.

Arcane
http://arcanecode.com

"Claude Grecea" <cg*****@shionogi-usa.comwrote in message
news:uK*************@TK2MSFTNGP05.phx.gbl...
Yes, I am using a "WindowsForm", but I would not like to call a Dialog
because of same issue. What I would like to happen is every time the "For
Loop" goes thru each iteration to stop and wait for user input in the
"TextBox". Is there a method to call for this particular situation?

Claude
"Arcane Code" <ar********@gmail.comwrote in message
news:u4**************@TK2MSFTNGP02.phx.gbl...
>I'm assuming you are using Windows/WinForms and not web?
>If so, you would need to put the text box on a form, then on the form you
could use the ShowDialog method of the form. When you call
[formnamehere].ShowDialog(... processing will stop in your loop until the
Hide or Close method of the form is called. Assuming you also had an OK
button on the form, in it's stuff the text box's text property into a new
property for the form, then call this.Hide. That way back in the loop
you can call the [formnamehere].mynewpropertyname to get what the user
keyed in, then [formnamehere].Close to close it.

I have to say though, calling a dialog box like that over and over is
going to make for a really bad user experience. You need to seriously
rethink this, and see if there's a better way to implement the interface.
I know if I were a user I wouldn't be happy about having this dialog pop
up over and over demanding info.

Robert
http://arcanecode.com

"Claude Grecea" <cg*****@shionogi-usa.comwrote in message
news:Oj**************@TK2MSFTNGP05.phx.gbl...
>>If anyone could help, I would greatly appreciated.

I am using a "For Loop" and thru each complete iteration I would like it
to stop and ask for user input, but I would not like to use a
MessageBox. Instead, I would like to use a Textbox. Is there a way for
me to accomplish this? Thanks in advance!

Claude

May 3 '07 #5
What you're wanting is essentially a terminal or console window.

Let me suggest a quick and dirty trick: Tell the compiler that your Windows
app is a console app. Then it will have a console window as well as the
other windows. On the console window, you can do Console.ReadLine() which
is a quick and simple way to get what you want. And, of course, you can
write in it and do other things to it with the other Console methods.

I'm going to have to give some thought to what you have to do to make a
regular textbox act like a console.
May 3 '07 #6

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

Similar topics

4
by: Jurjen de Groot | last post by:
I'm developing a ASP.NET/VB.NET web application. (VS.NET 2003) I've created several webpages, but on two pages one textbox colors yellow (the background) and I can't get the background to appear...
0
by: Newasps | last post by:
Hi guys, I have a problem with UpdateCommand Event. In tihs event Ä°'m creating required controls to get that controls' values and also get them. But when I try to get updated values I'm getting the...
2
by: Alex Shirley | last post by:
HI I'm trying to iterate through all the textboxes on a webpage and trim them for spaces. i.e. If a user enters " hello world " we correct it to "hello world" So far I've come up with...
1
by: Shilpi Chaudhry | last post by:
I have a forloop which I use to create textboxes - but unfortunately all of them have the same ids - I need to assign different ids to these textboxes creeated in the loop so that I can retrieve...
2
by: simon | last post by:
hello, new to vb.net, have a few questions about DataGrid. I have a dataGrid that is working pulling a dataset back from a stored proc and binding to the datagrid for display the datagrid's...
8
by: Filipe Marcelino | last post by:
Hi, I'm trying to create a textbox inheriting from the standard textbox. I would like to: 1. repaint the textbox border; 2. define a color for that border; Till now I made this:
0
by: G | last post by:
Hello friend, I am using a textbox with in a forloop, for each time when i click a button it genarates a new textbox, so for example for first time there will be 1 textbox, i will enter some...
0
KalariaNitya
by: KalariaNitya | last post by:
Hello, could anybody help me? i have gridview, inside gridview i have one Update button & textbox update button update the quantity entered in textbox. i want to update the quantity on textbox on...
6
by: john | last post by:
I have the following textbox setup with Text & ToolTip Bindings as follows; I'm using Visual Studio 2008 VB: <asp:TextBox ID="txtDay1" runat="server" Text='<%# Eval("Day1") %>'...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.