Solved

NO TEXT IN TEXT BOX

Posted on 2004-03-28
6
258 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
countHi2 challenge 7 52
mapShare challenge 13 89
base64 decode encode 12 119
Scripting vs. Programming languages 25 151
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.
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

910 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

23 Experts available now in Live!

Get 1:1 Help Now