Solved

regarding label updation

Posted on 2003-11-12
4
179 Views
Last Modified: 2010-05-03
hi,
 In mscomm_event() i have a label which display the value of integer variable which is incremented in mscomm_event().Its not getting updated when data is continuously coming in the mscomm_event().It gets updated only after all the data is received.how to display the value in the label when mscomm_event is triggred each time.kindly help me regarding this

0
Comment
Question by:swatcat5555
[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
4 Comments
 

Accepted Solution

by:
twili earned 30 total points
ID: 9730993
Add a line after it is incremented that refreshes the label.
----------------------------------------

  counter = counter + 1
  label1.caption = cstr(counter)
  Label1.Refresh                       <---- Insert this line

-------------------------------------------

/O.
0
 
LVL 26

Expert Comment

by:EDDYKT
ID: 9731023
OR

use doevents after
0
 
LVL 1

Expert Comment

by:KeyPakt
ID: 9731130
Depending on what your case is you need to choose which to use. If you use the .Refresh method you will only update the label but if you use the DoEvents method you will update all controls that are visible. DoEvents lets the system (Windows) take over for a period of time to do some system work and when it has finished that it will return the control to the application. A refresh event can be stored in the system list of things to do and that's why your control will be updated after DoEvents.

If you have a application that will run for several minutes you should use DoEvents because then the application will not slow down so much during time, otherwise your app will consume the power from the system.
0
 

Author Comment

by:swatcat5555
ID: 9737710
thanx a lot.
0

Featured Post

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

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

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

691 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