473,378 Members | 1,617 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

label captin not displaying stopwatch smoothly

228 100+
I forgot where i got this code but it is a stopwatch and works perfect. i tweaked it to meet my requirements but I forgot its original source location.


I have download DS-DIGIT.TTF for diplaying 00:00:00.00 format in digital form. it looks smooth when the font is small, like 8-9. but i want to make the font big, at least 72. but each time it updates the times, there is a flicker in the caption. i thot a faster interval at a timer control would fix it but it didn't. any suggestions?

Expand|Select|Wrap|Line Numbers
  1.  
  2. Private Sub Command14_Click()
  3.  
  4. If Command14.Caption = "Start" Then
  5.  fTimerStart = Timer
  6.     tmrStopwatch.Enabled = True
  7.     Command14.Caption = "Stop"
  8.     Else
  9.     stopwatch = True
  10.     tmrStopwatch.Enabled = False
  11.     Command14.Caption = "Start"
  12.    End Sub
  13.  
  14.  
  15. Private Sub tmrStopwatch_Timer()
  16.     Dim fTime As Single
  17.  
  18.     fTime = Timer - fTimerStart
  19.     lblStopwatchDisplay.Caption = Format(CSng(fTime / 86400), "hh:nn:") & Format((CLng(CDbl(fTime) * 1000) Mod 60000) / 1000, "00.00")
  20. End Sub
  21.  
  22.  
  23.  
  24.  
Mar 6 '11 #1
1 1517
Guido Geurs
767 Expert 512MB
Is the text on the label centered?
Don't: the program recalculates each time the center to place the text and this gives the flicker: first it sets the text and then it places it in the center.
Just align to the left or right and adapt the width of the label (it can because the length of the text is constant)
for demo: see attachment
Attached Files
File Type: zip label captin not displaying stopwatch smoothly_v1.zip (1.9 KB, 55 views)
Mar 6 '11 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Label over bitmap display | last post by:
Hello, I hope that someone can help me. I am developing code with C# .NET to display units which are on a Serial (RS232) Network. For my display I have to use a bitmap of the item and on top...
3
by: Patrick.O.Ige | last post by:
I created a USERCONTROL and i want to call a LABEL from an ASPX page. The USERCONTROL is in the ASPX page I have the label :- Label lblstr = new Label(); And displaying using:-...
5
by: Xero | last post by:
I have written a program that functions similarly to a stopwatch. When the user clicks the button, a label on the form starts counting. The program, however, does not tick once a second. How can I...
4
by: Jason Chan | last post by:
How can I get the month and year a calendar control current displaying? My problem is I want to load a list of event to a calendar so that it display difference style if there a event for a day....
1
by: sck10 | last post by:
Hello, I am pulling data from a SQL Server table. One field that is (varchar 4000) is used to show notes. I am using a FormView for showing and editing the data. When the form is in Item...
5
by: not_a_commie | last post by:
So I have a motherboard with multiple CPU sockets. It seems that if I create a StopWatch on one thread and then call the Elapsed member from a different thread that sometimes I get a tick count...
3
by: Jeff Jarrell | last post by:
I am unable to add up two timespans as created by the System.Diagnostics.Stopwatch class. Each stopwatch should be about two seconds and is appears ok, but when I try and add them up it goes to...
4
by: PlusNet | last post by:
Why doesn't the following work? Dim MyStopwatch() as Stopwatch ...Later in the code redim preserve MyStopwatch(10) ...Later in the code MyStopwatch(1).start
1
by: fightclub777 | last post by:
Hi, I've done some reasearch to be able to find the best way of acheiving this, but have been unlucky so far. What I'm trying to do is create a stopwatch on a .net page, whereby when a user clicks...
1
by: Craig Nielsen | last post by:
Part of my job is to run speed tests on SW to quantify the speed and identify regressions. I run these tests on pc's which drive DUTs (equipment). The Stopwatch class has worked for me until I...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.