Results 1 to 11 of 11

Thread: Process bars...

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jun 2002
    Posts
    22

    Process bars...

    How can i make a process bar go from like 10 to 90, 7 or 8 times?

  2. #2
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428
    I honestly dont think this is what you want, but I gave it a try anyways

    VB Code:
    1. Private Sub Timer_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer.Tick
    2.         Static counter As Integer = 0
    3.  
    4.         If counter = 0 Then
    5.             pBar.Value = 10
    6.         End If
    7.         If pBar.Value < 90 Then
    8.             pBar.Value += 10
    9.         Else
    10.             pBar.Value = 10
    11.             counter += 1
    12.         End If
    13.  
    14.         If counter = 7 Then
    15.             Timer.Enabled = False
    16.             counter = 0
    17.         End If
    18.     End Sub

    again, if that's not your answer, you have to exPLAIN your question more!
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Jun 2002
    Posts
    22
    No... That wasn't what i was looking for/didn't work.

    Okay. You have an empty process bar right?
    Now i want it so when the app loads the proccess
    bar will go from the value of 0 to the value 100
    3 times.


    |= 1 block in the process bar.

    |-----------------------> ||||||||||
    |-----------------------> ||||||||||
    |-----------------------> ||||||||||

  4. #4
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428
    well the code that I gave you will move it from 10 to 90 for 7 times. You have to add a timer control and name it "Timer" and set the enabled property to true. Modify that and make it work for what you want.
    I dont know if there is a good way to get rid of the stupid timer control though
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  5. #5

    Thread Starter
    Junior Member
    Join Date
    Jun 2002
    Posts
    22
    Thanks i got it to work.

  6. #6
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428
    just wondering if the code I posted helped at all
    if not, could you post your code?
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  7. #7

    Thread Starter
    Junior Member
    Join Date
    Jun 2002
    Posts
    22
    Wait a sec... its recognizing the code, but when i executed the program it didn't do anything. it just stayed on 10 (which is 2 bars)


    Private Sub Timer_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
    Static counter As Integer = 0

    If counter = 0 Then
    ProgressBar1.Value = 10
    End If
    If ProgressBar1.Value < 90 Then
    ProgressBar1.Value += 10
    Else
    ProgressBar1.Value = 10
    counter += 1
    End If

    If counter = 7 Then
    Timer1.Enabled = True
    counter = 0
    End If
    End Sub


    Thats what i have in. Tell me if its wrong

  8. #8
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428
    first, put your code in the [vbcode] and [/vbcode] tags when you post codes

    umm why did you change
    Timer.Enabled = False
    to
    Timer.Enabled = True
    ?




    What I ment was that the timer has to be started so that the code inside it would run. That's probably your problem. Add a command button to the form or put this in Form_Load
    Timer.Enabled = True


    OR you can just set the Enabled property to true when you are designing the form ( in the properties window)
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  9. #9

    Thread Starter
    Junior Member
    Join Date
    Jun 2002
    Posts
    22
    So put Form_Load
    Timer.Enabled = True

    into a button?....

    its not recognizing the Form_Load

  10. #10
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428
    sorry I'm confusing you

    VB Code:
    1. Private Sub Timer_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer.Tick
    2.         Static counter As Integer = 0
    3.  
    4.         If pBar.Value < 90 Then
    5.             pBar.Value += 10
    6.         Else
    7.             pBar.Value = 10
    8.             counter += 1
    9.         End If
    10.  
    11.         If counter = 7 Then
    12.             Timer.Enabled = False
    13.             counter = 0
    14.         End If
    15.     End Sub
    16.  
    17.     Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    18.         Timer.Enabled = True
    19.     End Sub

    try that
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  11. #11
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428
    sorry I'm confusing you

    VB Code:
    1. Private Sub Timer_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer.Tick
    2.         Static counter As Integer = 0
    3.  
    4.         If pBar.Value < 90 Then
    5.             pBar.Value += 10
    6.         Else
    7.             pBar.Value = 10
    8.             counter += 1
    9.         End If
    10.  
    11.         If counter = 7 Then
    12.             Timer.Enabled = False
    13.             counter = 0
    14.         End If
    15.     End Sub
    16.  
    17.     Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    18.         Timer.Enabled = True
    19.     End Sub

    try that
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width