Barra de progreso desde cmd VB

Necesito que me ayuden
debo crear una barra de progreso y llamarla desde un command
por favor ayudenme!!!!
Respuesta
1
Estimado aqui te dejo el codigo fuente.
BarraPorc. Frm
VERSION 5.00
Begin VB.Form Form1
Caption = "Barra de progreso"
ClientHeight = 2880
ClientLeft = 45
ClientTop = 330
ClientWidth = 5565
LinkTopic = "Form1"
ScaleHeight = 2880
ScaleWidth = 5565
StartUpPosition = 3 'Windows Default
Begin VB.CommandButton Command1
Caption = "Iniciar"
Height = 492
Left = 2280
TabIndex = 1
Top = 2040
Width = 972
End
Begin VB.PictureBox Picture1
AutoRedraw = -1 'True
DragMode = 1 'Automatic
DrawWidth = 3
ForeColor = &H00800000&
Height = 492
Left = 360
ScaleHeight = 435
ScaleWidth = 4755
TabIndex = 0
Top = 720
Width = 4812
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'Option Explicit
Private Sub Command1_Click()
Picture1.ForeColor = RGB(0, 0, 255)
For i = 0 To 100
actualizaprogress Picture1, i
Call pausa
Next i
'Picture1.Cls ' limpia la barra al final
End Sub
Private Sub actualizaprogress(pb As Control, ByVal percent)
Dim num$ ' porcentaje
'el autoredraw debe estar a = true
pb.Cls
pb.ScaleWidth = 100
pb.DrawMode = 10
num$ = Format(percent, "##") + "%"
pb.FontSize = 18
pb.CurrentX = 50 - pb.TextWidth(num$) / 2
pb.CurrentY = (pb.ScaleHeight - pb.TextHeight(num$)) / 2
pb.Print num$
pb.Line (0, 0)-(percent, pb.ScaleHeight), , BF
pb.Refresh
End Sub
Private Sub pausa()
Dim controlar
Dim comenzar
comenzar = Timer
Do Until controlar >= comenzar + 0.2
controlar = Timer
DoEvents
Loop
End Sub
Y AHORA LA OTRA PARTE :
BarraPorc.vbp
Type=Exe
Form=BarraPorc.frm
Reference=*\G{00020430-0000-0000-C000-000000000046}#2.0#0#..\..\..\WINDOWS\System32\stdole2.tlb#OLE Automation
IconForm="Form1"
Startup="Form1"
Command32=""
Name="Project1"
HelpContextID="0"
CompatibleMode="0"
MajorVer=1
MinorVer=0
RevisionVer=0
AutoIncrementVer=0
ServerSupportFiles=0
VersionCompanyName="Producciones Echeverría Multimedia"
CompilationType=0
OptimizationType=0
FavorPentiumPro(tm)=0
CodeViewDebugInfo=0
NoAliasing=0
BoundsCheck=0
OverflowCheck=0
FlPointCheck=0
FDIVCheck=0
UnroundedFP=0
StartMode=0
Unattended=0
Retained=0
ThreadPerObject=0
MaxNumberOfThreads=1
[MS Transaction Server]
AutoRefresh=1

Añade tu respuesta

Haz clic para o

Más respuestas relacionadas