|
-
Oct 28th, 2009, 12:52 PM
#1
Thread Starter
Junior Member
[RESOLVED] Timer problem
This code countdown from 10 seconds to 0 second,then capture image and save to the specific folder,and than countdown to -1,-2,-3 etc,but I don't wont thet count to -1,-2,-3 etc...
I would like to do that when it comes to 0 seconds,that the timer countdown again from 10 second countdown to 0 and overvrite the image
Can somebody explain me how to do it?Thanks for any help
this is code
Code:
Public Class Form1
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Dim SC As String = 0
Label1.Text -= SC + 1
If Label1.Text = 0 Then
End If
If Label1.Text = 0 Then
Try
Dim scr As Size = New Size(My.Computer.Screen.Bounds.Width, My.Computer.Screen.Bounds.Height)
Dim screenGrab As New Bitmap(My.Computer.Screen.Bounds.Width, My.Computer.Screen.Bounds.Height)
Dim G As System.Drawing.Graphics = System.Drawing.Graphics.FromImage(screenGrab)
G.CopyFromScreen(New Point(0, 0), New Point(0, 0), scr)
screenGrab.Save("C:\test.jpeg")
Catch ex As Exception
End Try
End If
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Label1.Enabled = True
Timer1.Start()
End Sub
Private Sub Label1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label1.Click
Label1.Enabled = False
End Sub
End Class
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|