469,579 Members | 1,214 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,579 developers. It's quick & easy.

TextBox Update inside of a loop (.Net 1.1) / VS 2003

Hello,

I have a simple loop that adds values to a textbox. I would like to have it refresh the text box every 100 records so that the end user still believes it is processing data (it sometimes crunches several thousand records). I don't have the .refresh method for a textbox in .Net 1.1. How was this accomplished prior to 2.0? Below is an example of the behavior simiar to what I want.

Thanks in advance


for i = 0 to 1000

textBox.Text = i
textBox.refresh()
System.Threading.Thread.Sleep(200)

Next
Jul 2 '08 #1
5 4073
debasisdas
8,127 Expert 4TB
what do you want this code textBox.refresh() to do ?

what is the use of refreshing a textbox inside a loop ?
Jul 3 '08 #2
I have some code that processes some numbers (several thousand at a time). I would like to update the end user of the progress so they don't wait for 5+ minutes while it assembles this list. Basically my code takes input from one list and then sorts it and puts it in one of 3 lists classifying if they are valid, invalid, incomplete. Within this loop I would like the code to update the text box so the user can visually see that the code is working rather than waiting several minutes for the code to complete.

Does that make sense? The big question is.... I don't have access to the .refresh method for a textbox. I'm using Dot Net 1.1 with VS 2003. I'm wondering if they offered the ability to do something similar with older code.


Thanks
Jul 3 '08 #3
QVeen72
1,445 Expert 1GB
Hi,

When it is being continously changing, add "DoEvents"


for i = 0 to 1000
textBox.Text = i
DoEvents
System.Threading.Thread.Sleep(200)
Next

I guess, if you are wanting to Display, the Position/Record Count in a loop like that, "StatusBar" is the best control. It auto refreshes itself, and dosent flicker or gets blurred..

Regards
Veena
Jul 3 '08 #4
In my version of DotNet (1.1) I don't have a statusbar control. I also don't have the DoEvents Method to call in the function. I may need to directly reference it similar to the sleep function. Do you know the full path of DoEvents or the statusbar?

Example (System.Threading.Thread.Sleep)

Thanks
Jul 3 '08 #5
QVeen72
1,445 Expert 1GB
Hi,

Sorry for replying so late..

in VB.net it is :
Application.DoEvents

and StatusBar is called as StatusStrip in VB.net. It is available in General ToolBox under "Menu and ToolBars"

Regards
Veena
Jul 25 '08 #6

Post your reply

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

Similar topics

3 posts views Thread by Sonoman | last post: by
14 posts views Thread by Mike L | last post: by
28 posts views Thread by kfrost | last post: by
2 posts views Thread by hamil | last post: by
3 posts views Thread by Billy Bob | last post: by
5 posts views Thread by =?Utf-8?B?RmFtaWx5IFRyZWUgTWlrZQ==?= | last post: by
reply views Thread by suresh191 | last post: by
4 posts views Thread by guiromero | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.