M sending my code... i want to convert this code to VB6.0
Private Sub Button1_Click(B yVal sender As System.Object, ByVal e As System.EventArg s) Handles Button1.Click
Dim sW As Stopwatch = New Stopwatch
'Used to start or stop the loop.
Dim stopLoop As Integer = 0
Dim sec As Integer = Nothing
'Reset the loop variable.
stopLoop = 0
'Start the stopWatch.
sW.Start()
'Check if the timer is using the high resolution timer or the
'datetime class.
lblHighRes.Text = "High Resolution Mode: " & _
Stopwatch.IsHig hResolution.ToS tring
' stop_Renamed_Cl ick.Focus()
'Just some simple little loop used to get the stopWatch to
'elapse time just as a basic example of using the stopWatch
'class.
Do
My.Application. DoEvents()
'Show the various elapsedTime numbers.
lblElapsed.Text = sW.Elapsed.ToSt ring
'lblElapsedTick s.Text = "Elapsed Time (Ticks): " & _
' sW.ElapsedTicks .ToString()
' lblElapsedMilli .Text = "Elapsed Time (Milliseconds): " _
' & sW.ElapsedMilli seconds
'Calculate to get the current seconds.
sec = sW.ElapsedMilli seconds \ 1000
'Get the elapsed time in seconds.
lblElapsedSec.T ext = "Elapsed Time (Seconds): " & _
sec.ToString
'Check whether the stopWatch is running or not.
lblRunning.Text = "StopWatch Running: " & _
sW.IsRunning.To String
'Continue to loop until the stop button is pushed.
Loop Until stopLoop = 1
so are you saying there is an automated process for this?
or is this a manual job?
Hi James,
Yes there is..
Open a VB6 Project in VB.net IDE, the project will be converted to vb.net automatically..
as Debasis said, there is no Reverse Procedure..
Start a New Project, add a Timer Control, Command Button, and Labes to your form. and Re-name them accordingly..
Use same Command Button to Start and Stop.
Keep Form-Level variables to Increment Seconds/Milli seconds..
Initially make Command's Caption = "Start", Timer's Enabled = False,
Set Timer's Interval.
In Command Click write this code:
If Command1.Captio n ="Start" then
Command1.Captio n = "Stop"
Timer1.Enabled =True
Else
Command1.Captio n = "Start"
Timer1.Enabled =False
End If
Write the Increment of Variables in Timer1_Timer Event..
also Change the Caption of all the Labels Accordingly..
Comment