Solved

FAST LIST BOX DURING READING DATA RECORDS

Posted on 2006-06-15
6
241 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 
LVL 15

Expert Comment

by:bpmurray
Comment Utility
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
Comment Utility
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
Comment Utility
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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

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 …
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
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 …
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

762 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now