Solved

NO TEXT IN TEXT BOX

Posted on 2004-03-28
6
269 Views
Last Modified: 2013-11-13
I was wondering if any one know why when I turn on the text in a message box before
I go into a loop that processed data or does other things the text does not display.  The box will
display but when I put up a message like a count of were I am or some information of what is going on the box is blank.  If I pause in a debug mode the text will display and be there if I continue.
I suppose if I put a big delay in it might show up before I started processing but I am not sure why its not displaying  - Any one experienced this??

0
Comment
Question by:rswickersham
[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
6 Comments
 
LVL 14

Accepted Solution

by:
Farzad Akbarnejad earned 125 total points
ID: 10701488
Hi,
If you are using Visual Basic use DoEvents statement in your loop.

-FA
0
 
LVL 9

Expert Comment

by:bhagyesht
ID: 10701552
FarzadA said it right. basically what happens is that VB is doing the processing the screen painting /refreshing being at lower priority is ignored. when you give doevents it gives the system some time to carry out events like painting the screen or refresshing. remember though each call reduces the speed of ur program.
Bhagyesh Trivedi
0
 
LVL 6

Expert Comment

by:mmusante
ID: 10701993
You can also call the refresh method of your textbox
0
What Is Transaction Monitoring and who needs it?

Synthetic Transaction Monitoring that you need for the day to day, which ensures your business website keeps running optimally, and that there is no downtime to impact your customer experience.

 
LVL 15

Expert Comment

by:SRigney
ID: 10704011
Check that Option Explicit is on.

If you are setting the text into one variable and displaying another due to a mistyping of the variable name then it will display nothing.
0
 
LVL 2

Expert Comment

by:KhunJean
ID: 10706769
mmusante is right.

Use the refresh method.

By the way if you have a need for speed use a label instead of a textbox.
It is a little faster in repainting. And if you use it in a tight loop. refresh it just once in a while.

As a sidenote
DoEvents can be very dangerous. Use it with care.
With a doEvents your program flow can be different than you expect.
Try using it in a dataarrival event from a winsock and you'll see what i mean.
Another bad habit of doEvents when used often is it will push up your CPU usage in the taskmanager to a 100%. That can give a false impresion about the real cpu usage of your program.

When you need a little pause in your programm or give some cpu time to another process use Sleep()

And SRigney is SO right.
A lot of mistakes even typos can be detected while compiling. A make exe once in a while is a good practice if your program gets a bit bigger. Just running it from VS will not do a full compile.






0
 
LVL 15

Expert Comment

by:SRigney
ID: 10707320
You can do a start with full compile ctrl+f5 and it will verify everything is correct as it does with an actual compile.
0

Featured Post

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!

Question has a verified solution.

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

A short article about a problem I had getting the GPS LocationListener working.
Computer science students often experience many of the same frustrations when going through their engineering courses. This article presents seven tips I found useful when completing a bachelors and masters degree in computing which I believe may he…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
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 …

705 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