تقييم الموضوع :
  • 0 أصوات - بمعدل 0
  • 1
  • 2
  • 3
  • 4
  • 5
[VB.NET] بخصوص التايمر
#1
كيف اجعل التايمر يقف عند وصوله 30% علي البروجرس بار 4 ثواني ومن ثم يكمل عد حتي يصل الي 60% ويقف 4 ثواني وثم يكمل عد حتي يصل 90% ويقف 4 ثواني كيف يتم ذلك
الرد }}}
تم الشكر بواسطة:
#2
السلام عليكم ورحمة الله وبركاته

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

ProgressBar1.Maximum = 100
       Timer1.Interval = 1000
       Timer1.Start()
   End Sub

'لحساب الأربع ثوان
Dim count As Integer
    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        If ProgressBar1.Value <> 30 And ProgressBar1.Value <> 60 And ProgressBar1.Value <> 90 Then
            ProgressBar1.Value += 1
        Else
            If count = 4 Then
                ProgressBar1.Value += 1
                count = 0
            Else
                count += 1
            End If
        End If

        If ProgressBar1.Value = 100 Then
            Timer1.Stop()
        End If

    End Sub




تمنياتي لك وللجميع التوفيق
الرد }}}
تم الشكر بواسطة:



التنقل السريع :


يقوم بقرائة الموضوع: بالاضافة الى ( 1 ) ضيف كريم