Visualizzazione dei risultati da 1 a 6 su 6

Discussione: [VB6] ProgressBar

  1. #1

    vb6 -- Progressbar

    ciao a tutti

    qualcuno di voi sa dirmi come si usa una progress bar?

    grazie mille....

  2. #2
    Utente di HTML.it L'avatar di LMondi
    Registrato dal
    Sep 2004
    Messaggi
    1,291
    Un esempio molto valido l'ha postato xegallo (Moderatore) qualche giorno fà, che qui riporto dopo averlo ringraziato:
    codice:
    Option Explicit
    Dim FSO As FileSystemObject
    Dim f As File
    Dim dSorg As Folder
    '-----------------------
    Private Sub Form_Load()
        ProgressBar1.min = 0
        ProgressBar1.max = 100
        Set FSO = New FileSystemObject
    End Sub
    '-----------------------
    Private Sub Command1_Click()
        Dim dirLenght As Long
        Dim fileLenght As Long
        Dim bytesscritti As Long
    
        Set dSorg = FSO.GetFolder("D:\DATI1")
    
        dirLenght = dSorg.Size
    
        For Each f In dSorg.Files
            fileLenght = f.Size
            f.Copy "D:\"
            ProgressBar1.value = Percent(0, dirLenght, bytesscritti + fileLenght)
            bytesscritti = bytesscritti + fileLenght
            ProgressBar1.Refresh
        Next f
    
    End Sub
    '--------------------------
    Function Percent(min As Long, max As Long, value As Long) As Long
        '100 : x = dirlenght : bytes
         Percent = value * 100 \ max
    End Function
    PS. ricorda di attivare il riferimento a Microsoft Scripting Runtime.
    LM

  3. #3
    In una progressBar durante l'avanzamento si può vedere una barra continua invece di tanti rettangolini?

  4. #4
    Utente di HTML.it L'avatar di LMondi
    Registrato dal
    Sep 2004
    Messaggi
    1,291
    Ciao maurocoviello,
    la proprietà che devi settare è Scrolling=1
    LM

  5. #5
    Grazie Mille!!!!!!

  6. #6
    Utente di HTML.it L'avatar di LMondi
    Registrato dal
    Sep 2004
    Messaggi
    1,291
    Se cerchi un tutorial sulla progressBar con un esempio funzionante lo trovi qui:
    http://www.masterdrive.it/default.asp?modulo=Community
    Ciao.
    LM

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.