?
Solved

FAST LIST BOX DURING READING DATA RECORDS

Posted on 2006-06-15
6
Medium Priority
?
280 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
  • 2
6 Comments
 
LVL 86

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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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 86

Accepted Solution

by:
Mike Tomlinson earned 2000 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

A short article about problems I had with the new location API and permissions in Marshmallow
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
Progress
Suggested Courses

771 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