I am working on vb.net window form application. Here i have a main window where there several .gif images. These images will animate according to values coming from database. On clicking any images a popup window will open. On this Popup window there are six button. On clicking any of the button the respective value in Sql server database Table will updated to 1 and after 1 second the same value will get updated to 0. For this i used following code
Private Sub btnStart_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnStart.Click
Try
If (Label1.Text.Contains("Drag")) Then
tag2 = "D" + Label1.Text.Substring((Len(Label1.Text.ToString()) - 1), 1)
Else
tag2 = Label1.Text.Trim().ToString()
End If
ObjTags.Name = tag2 + ".Start"
btnStart.Enabled = False
ObjTags.DigitalValue = 1
i = ObjTags.UpdateConValue(6)
Application.DoEvents()
Thread.Sleep(1000)
ObjTags.DigitalValue = 0
i = ObjTags.UpdateConValue(6)
btnStart.Enabled = True
Catch ex As Exception
End Try
End Sub
This is working good. On clicking button the respective value in database gets updated to 1 and after 1 second it will gets updated to 0. But during this operation the .gif images in main page stop animating. How to solve this?