[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

FAST LIST BOX DURING READING DATA RECORDS

Posted on 2006-06-15
6
Medium Priority
?
288 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 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

In real business world data are crucial and sometimes data are shared among different information systems. Hence, an agreeable file transfer protocol need to be established.
We live in a world of interfaces like the one in the title picture. VBA also allows to use interfaces which offers a lot of possibilities. This article describes how to use interfaces in VBA and how to work around their bugs.
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 …
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

834 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