Visual Basic.NET

93K

Solutions

24K

Contributors

Visual Basic .NET (VB.NET) is an object-oriented programming language implemented on the .NET framework, but also supported on other platforms such as Mono and Silverlight. Microsoft launched VB.NET as the successor to the Visual Basic language. Though it is similar in syntax to  Visual Basic pre-2002, it is not the same technology,

Share tech news, updates, or what's on your mind.

Sign up to Post

This is how to create simple Timer (Stopwatch) in VB.NET

Make a form with 1 Label, 1 Timer and 1 Button
Set the interval of timer in = "1"

use this code

Public Class Form1
Private Stopwatch As New Stopwatch
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load

End Sub

Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
Dim elapsed As TimeSpan = Stopwatch.Elapsed
Label1.Text = String.Format("{0:00}:{1:00}:{2:00}:{3:00}",
Math.Floor(elapsed.TotalHours),
elapsed.Minutes, elapsed.Seconds, elapsed.Milliseconds)
End Sub

Private Sub Button5_Click(sender As Object, e As EventArgs) Handles Button5.Click
If Button5.Text = "Start" Then
Timer1.Start()
Stopwatch.Start()
Button5.Text = "Stop"
ElseIf Button5.Text = "Stop" Then
Timer1.Stop()
Stopwatch.Stop()
Button5.Text = "Start"
End If
End Sub
End Class
0
Cloud Class® Course: MCSA MCSE Windows Server 2012
LVL 12
Cloud Class® Course: MCSA MCSE Windows Server 2012

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

A real head scratcher

SQL Server 2005
Web Service .Net Framework 3.5
Symbol MC3190
VB.NET Compact Framework 3.5

Dates consumed by the compact framework are shifted by the difference in the timezone between the server and the client.

Luckily for me the fix was as just a matter of setting the client machines timezone to that of the server.

Just putting it out there in case someone runs into something similar.

https://social.microsoft.com/Forums/en-US/9858d657-ce26-442a-86a7-e2ba6b774ebf/sync-framework-over-wcf-sql-2005-datetime-is-shifted-by-timezone?forum=syncgeneral


0
For anyone that has a similar issue

Windows 10 Pro
VS 2008
Windows Forms App for Symbol MC3190 - Windows 5 CE

After Windows 10 update, VS 2008 failed to load the project - with error :
File  microsoft.compactframework.visualbasic.targets not found
Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.

I seem to have solved this by installing
NETCFv35PowerToys.msi
from
https://www.microsoft.com/en-ie/download/details.aspx?id=13442

Rgds,
Jonathan
1

Visual Basic.NET

93K

Solutions

24K

Contributors

Visual Basic .NET (VB.NET) is an object-oriented programming language implemented on the .NET framework, but also supported on other platforms such as Mono and Silverlight. Microsoft launched VB.NET as the successor to the Visual Basic language. Though it is similar in syntax to  Visual Basic pre-2002, it is not the same technology,