Timer

Timer interval

Page 1 of 1

4 Replies - 1176 Views - Last Post: 07 November 2010 - 02:40 AM Rate Topic: -----

#1 AbrarHuniedi  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 10
  • Joined: 30-October 10

Timer

Posted 04 November 2010 - 11:48 PM

I have one Timer1 and I set intreval in properties with 100
Also I have two picturebox with image, when picturebox1 with progressBar1 are show,after that picturebox2 with progressbar2 will show?

My problem pictureBox1 , picturebox2 ,progressBar1,progressBar2,show together? What I can do to become pictureBox1 with progressbar1 show first, after two second picturebox2 with progressbar2 show?

This is my code>>>>

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

       
        Timer1.Enabled = False
PictureBox1.Hide()
PictureBox2.Hide()

ProgressBar1.Hide()
 ProgressBar2.Hide()
End Sub

Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick


        Dim a As Integer

        Dim text1Frame As String
        Dim text2ACK As String
        Dim textLost As String

        text1Frame = TextBox1.Text()
        text2ACK = TextBox2.Text()
        textLost = TextBox3.Text()


        

        If Timer1.Enabled = True And text1Frame = "4" And text2ACK = "0" And textLost = "0" Then
            a = Timer1.Interval

            
            If a = 100 Then

                ProgressBar1.Show()
                ProgressBar1.Enabled = True
                PictureBox1.Show()

                ProgressBar1.Increment(1)

            End If

            
            a = a + 100
            If a > 110 And a = 200 Then
                ProgressBar2.Show()
                ProgressBar2.Enabled = True
                PictureBox2.Show()


                ProgressBar2.Increment(1)
 End If
end if
End sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        

            Timer1.Enabled = True
        

    End Sub


MOD EDIT: When posting code...USE CODE TAGS!!!

:code:

This post has been edited by JackOfAllTrades: 05 November 2010 - 03:50 AM


Is This A Good Question/Topic? 0
  • +

Replies To: Timer

#2 maj3091  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 300
  • View blog
  • Posts: 1,781
  • Joined: 26-March 09

Re: Timer

Posted 05 November 2010 - 01:50 AM

In future, please post your code in the CODE tags, it makes it easier for people to read.

I think this maybe .NET code based on your timer declaration.

But, your code is slightly confused.

a = Timer1.Interval


If a = 100 Then

ProgressBar1.Show()
ProgressBar1.Enabled = True
PictureBox1.Show()

ProgressBar1.Increment(1)

End If


a = a + 100
If a > 110 And a = 200 Then
ProgressBar2.Show()
ProgressBar2.Enabled = True
PictureBox2.Show()


ProgressBar2.Increment(1)
End If


You set a=timer.interval, which is 100, so it satisfies the first IF statement. You then add 100 to a, so it will satisfy the second IF statement, so you will have no delay in there at all.
Was This Post Helpful? 0
  • +
  • -

#3 raziel_  Icon User is offline

  • Like a lollipop
  • member icon

Reputation: 465
  • View blog
  • Posts: 4,255
  • Joined: 25-March 09

Re: Timer

Posted 05 November 2010 - 02:03 AM

ProgressBar2.Increment(1) ?????
oh your using VB.NET wrong forum dude :)
Was This Post Helpful? 0
  • +
  • -

#4 AbrarHuniedi  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 10
  • Joined: 30-October 10

Re: Timer

Posted 05 November 2010 - 02:46 AM

[What i can do to have dealy?

Iam not understand
Was This Post Helpful? 0
  • +
  • -

#5 AbrarHuniedi  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 10
  • Joined: 30-October 10

Re: Timer

Posted 07 November 2010 - 02:40 AM

View PostNoBrain, on 05 November 2010 - 01:03 AM, said:

ProgressBar2.Increment(1) ?????
oh your using VB.NET wrong forum dude :)



Hi

I used visual basic 2005??

this code not is helpfull

what are you mean????
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1