Home
Forums
New posts
Search forums
What's new
New posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Search profile posts
C# Community
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Home
Forums
Visual Studio .NET
VS.NET General Discussion
about timertick
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="mzim" data-source="post: 86" data-attributes="member: 62"><p>halu i'll make a stop watch</p><p>here's the code</p><p>[code]</p><p>dim startime as datetime </p><p>Private Sub timertick_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles timertick.Tick </p><p> Dim span As TimeSpan = Date.Now.Subtract(startime) </p><p> Label1.Text = span.Hours.ToString & " : " & span.Minutes.ToString & " : " & span.Seconds.ToString & " . " & span.Milliseconds </p><p> End Sub </p><p>in the button1_click </p><p></p><p> If timertick.Enabled Then </p><p> timertick.Stop() </p><p> button1.Text = "click to start" </p><p> Else </p><p> startime = Date.Now() </p><p> timertick.Start() </p><p> button1.Text = "click to stop" </p><p> End If</p><p>[/code]</p><p>when i click stop the clock will stop...what i want is when i click start it will continue to where the time stop.. </p><p></p><p>for example: it will stop at 2.704 and when i click start it will continue like..2.705 up... </p><p></p><p>i hope it explains well. </p><p>tanx in advance and more power...<img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite2" alt=";)" title="Wink ;)" loading="lazy" data-shortname=";)" /></p></blockquote><p></p>
[QUOTE="mzim, post: 86, member: 62"] halu i'll make a stop watch here's the code [code] dim startime as datetime Private Sub timertick_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles timertick.Tick Dim span As TimeSpan = Date.Now.Subtract(startime) Label1.Text = span.Hours.ToString & " : " & span.Minutes.ToString & " : " & span.Seconds.ToString & " . " & span.Milliseconds End Sub in the button1_click If timertick.Enabled Then timertick.Stop() button1.Text = "click to start" Else startime = Date.Now() timertick.Start() button1.Text = "click to stop" End If [/code] when i click stop the clock will stop...what i want is when i click start it will continue to where the time stop.. for example: it will stop at 2.704 and when i click start it will continue like..2.705 up... i hope it explains well. tanx in advance and more power...;) [/QUOTE]
Insert quotes…
Verification
Post reply
Home
Forums
Visual Studio .NET
VS.NET General Discussion
about timertick
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.
Accept
Learn more…
Top
Bottom