Solved

FAST LIST BOX DURING READING DATA RECORDS

Posted on 2006-06-15
6
262 Views
Last Modified: 2010-04-17
In dos I was used to do:

View print 5 to 24
 color 0,7
 cls
 then while reading records to show user whats happening,
  print a$;chr$(179);b$;chr$(179);c$;chr$(179);d$
 read next, print next.

This way he will see the data comming over his screen

What would be the same doing in VB6  ?


0
Comment
Question by:BIAPRO
  • 2
  • 2
  • 2
6 Comments
 
LVL 85

Expert Comment

by:Mike Tomlinson
ID: 16911618
You could update a Label with the current record data being read.

Or add each record to the end of your listbox and move the selection to the end so it scrolls as records are added.  This slows down the process a bit though.

To see these updates you have to add a DoEvents to your loop though.
0
 
LVL 15

Expert Comment

by:bpmurray
ID: 16911630
Do you want this to continue running in a DOS box, or as a Windows GUI app? I presume the latter, so you need to create a form that will be your GUI. You'll probably add a button that says "Cancel" to allow the user to abort the program in the middle, and change the text to "OK" when it's finished. You can display what's happening by creating a text box that scrolls with whatever you display in it, similar to what you have to day. Alternatively you can have a single field that displays the current record, replacing it with the next one as it's being processed. The string you display is almost the same, although chr$(179) is not what you should use:

         TextBox1.Text = a$ + "-" + b$+ "-" + c$+ "-" + d$;
0
 

Author Comment

by:BIAPRO
ID: 16911741
The listbox will add records, but is not showing the records while they are added,
lstbox1.AddItem (a$)
and when its eof  then the list stands at top off box,
the idea was during long reads keep the user informed whats happening
0
ScreenConnect 6.0 Free Trial

At ScreenConnect, partner feedback doesn't fall on deaf ears. We collected partner suggestions off of their virtual wish list and transformed them into one game-changing release: ScreenConnect 6.0. Explore all of the extras and enhancements for yourself!

 
LVL 15

Expert Comment

by:bpmurray
ID: 16911896
No a listbox isn't great for this kind of thing (as you've already noticed). I think the best solution is to either use a text box where you manage scrolling yourself, or a simple set of fields that you set to the current record's values. You could also use a progressbar that indicates how much of the data has been processed.
0
 

Author Comment

by:BIAPRO
ID: 16911954
Ok, will play a bit, maybe a gridbox, and reshow grid after every 10 records or so
0
 
LVL 85

Accepted Solution

by:
Mike Tomlinson earned 500 total points
ID: 16912014
If you really want the newly added item to be seen then either change the TopIndex or the ListIndex property each time you add something new:

        lstbox1.AddItem "something..."
        lstbox1.TopIndex = lstbox1.ListCount - 1
        ' or
        lstbox1.ListIndex = lstbox1.ListCount - 1
0

Featured Post

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

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

Suggested Solutions

This article will show, step by step, how to integrate R code into a R Sweave document
Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

831 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