Solved

NO TEXT IN TEXT BOX

Posted on 2004-03-28
6
254 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
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
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: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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Having just graduated from college and entered the workforce, I don’t find myself always using the tools and programs I grew accustomed to over the past four years. However, there is one program I continually find myself reverting back to…R.   So …
This article will show, step by step, how to integrate R code into a R Sweave document
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
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…

707 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

17 Experts available now in Live!

Get 1:1 Help Now