Results 1 to 7 of 7

Thread: [RESOLVED] code help

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2006
    Posts
    736

    Resolved [RESOLVED] code help

    hi
    i would like to make a simple download indicator thought of basing it on a label tried the label with an increasing nuber string works fine but i would like something like this

    Download in progress........

    with an increasing number of dots or maybe like 10 dots then returning to 1 dot and runing again. any ideas with the code i cant see a way of +1 working as it seems not to recognise it.

    thanks

  2. #2
    PowerPoster lintz's Avatar
    Join Date
    Mar 2003
    Location
    The 19th Hole
    Posts
    2,697

    Re: code help

    Post your code.

  3. #3
    PowerPoster gavio's Avatar
    Join Date
    Feb 2006
    Location
    GMT+1
    Posts
    4,462

    Re: code help

    Put on your form:

    - CommandButton
    - Timer
    - Label and
    - WebBrowser

    ... and try this:
    VB Code:
    1. Option Explicit
    2.  
    3. Private Sub Command1_Click()
    4.     WebBrowser1.Navigate "http://www.VBForums.com"
    5.         Timer1.Enabled = True
    6. End Sub
    7.  
    8. Private Sub Form_Load()
    9.     With Timer1
    10.         .Enabled = False
    11.         .Interval = 50
    12.     End With
    13. End Sub
    14.  
    15. Private Sub Timer1_Timer()
    16.     Static dots As Integer
    17.         dots = dots + 1
    18.             If dots <= 10 Then
    19.                 Label1.Caption = "Downloading " & String(dots, ".")
    20.             Else
    21.                 dots = 0
    22.             End If
    23. End Sub
    24.  
    25. Private Sub WebBrowser1_DocumentComplete(ByVal pDisp As Object, URL As Variant)
    26.     Timer1.Enabled = False
    27.         Label1.Caption = "Download complete"
    28. End Sub

  4. #4
    Oi, fat-rag! bushmobile's Avatar
    Join Date
    Mar 2004
    Location
    on the poop deck
    Posts
    5,592

    Re: code help

    the timer sub can be done as:
    VB Code:
    1. Private Sub Timer1_Timer()
    2.     Static dots As Integer
    3.     dots = (dots Mod 10) + 1
    4.     Label1.Caption = "Downloading" & String$(dots, ".")
    5. End Sub

  5. #5

  6. #6

    Thread Starter
    Fanatic Member
    Join Date
    Nov 2006
    Posts
    736

    Re: code help

    lol only just came back to post my code and allready its sorted thanks gavio and the other posts too

  7. #7

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