Escolar Documentos
Profissional Documentos
Cultura Documentos
H
a
Animación de Imágenes r
l
1. Ubíquese en el formulario Fondo y defina las siguientes propiedades e
y
Height = 7020
Left = 2880 S
Top = 960 o
Width = 8895 l
BackColor = Blanco a
n
2. Insertar una etiqueta con las siguientes propiedades o
Nombre = Label1 *
Aligment = center *
Caption = Espere por Favor... Cargando el Sistema
Height = 975 H
Left = 1440 a
Top = 3240 r
Width = 4335 l
BackColor = Blanco e
Font = MS Sans Serit en Negrita, Cursiva y de 18 Pts. y
harley.solano@gmail.com hasx1@hotmail.com
Curso de Visual Basic Aplicado Harley Solano Sánchez 7
H
a
r
5. Insertar un objeto Timer con las siguientes propiedades l
e
Nombre = Timer1 y
Interval =1
Enabled = True S
o
6. Insertar otro objeto Timer con las siguientes propiedades l
a
Nombre = Timer2 n
Interval =1 o
Enabled = False
*
7. Escribir las siguientes lineas de codigos *
*
Objeto : Timer1 *
Evento : Timer H
a
Código : r
Private Sub Timer1_Timer() l
Image2.Left = Image2.Left + 350 e
Label1.Left=Label1.Left + 300 y
If Image2.Left >= 2540 then
Label1.Visible = False S
Label2.Visible = True o
Timer1.Enabled = False l
Timer2.Enabled = True a
Endif n
Fondo.AutoRedraw = False o
End Sub
harley.solano@gmail.com hasx1@hotmail.com
Curso de Visual Basic Aplicado Harley Solano Sánchez 8
H
a
r
Objeto : Timer2 l
e
Evento : Time2 y
Código : S
Private Sub Timer2_Timer() o
Image2.Left = Image2.Left - 350 l
If Image2.Left <= 240 then a
Timer2.Enabled = False n
Endif o
End Sub
*
*
Animación de Scroll Text (Marquesina Desplazándose)
H
1. Insertar un formulario al Proyecto, haga clic en Proyecto y Clic en Agregar formulario a
r
2. Definir las siguientes propiedades al formulario l
e
Nombre = Derechos y
Top = 30
Left = 2820 S
Height = 7460 o
Width = 9030 l
BackColor = Blanco a
BorderStyle = None n
ControlBox = False o
MDIChild = True
*
3. Inserte una etiqueta con las siguientes propiedades *
Nombre = ScrollText H
AutoSize = True a
BackColor = Blanco r
Top = 0 l
Left = -14160 (Notar que es un número negativo) e
Height = 795 y
Width = 14370
Caption = Sistema de Control de Inventario – Autolote El Mejor S
Font = Times New Roman, Negrita y Cursiva de 33 Pts o
l
4. Insertar un Timer con las siguientes propiedades
a
Nombre = Scroll n
Interval = 80 o
Enabled = True
harley.solano@gmail.com hasx1@hotmail.com
Curso de Visual Basic Aplicado Harley Solano Sánchez 9
H
a
5. Insertar el siguiente codigo en el formulario r
l
Objeto : Timer Scroll e
y
Evento : Timer
S
Código : o
Private Sub Scroll_Timer() l
If (ScrollText.Left + ScrollText.Width) <= 0 Then a
ScrollText.Left = 8640 n
End If o
ScrollText.ForeColor = QBColor(Rnd * 10)
ScrollText.Left = ScrollText.Left - 100 *
End Sub *
*
*
H
a
r
l
e
y
S
o
l
a
n
o
harley.solano@gmail.com hasx1@hotmail.com
Curso de Visual Basic Aplicado Harley Solano Sánchez 10
H
a
r
Animación de Avanzada de Imágenes l
e
Para esto seguiremos utilizando el formulario Derechos. y
harley.solano@gmail.com hasx1@hotmail.com
Curso de Visual Basic Aplicado Harley Solano Sánchez 11
H
a
r
Private Type RECT l
Left As Long e
Top As Long y
Right As Long
Bottom As Long S
End Type o
l
Const ScrollText1 As String = "Sistema de Control de Inventario" & vbCrLf & _ a
vbCrLf & vbCrLf & _ n
"Propiedad Intelectual de : Harley Solano Sánchez" & vbCrLf & _ o
"Versión : Has02-01-V Mayo - 2002" & _
vbCrLf & "Teléfono (505) 077-85377 " & _ *
vbCrLf & "E - Mail : hasx1@hotmail.com" & _ *
vbCrLf & vbCrLf & _
"http://harley.sitio.net" & _ H
vbCrLf & _ a
"http://www.geocities.com/hasx1" r
l
Dim EndingFlag As Boolean e
y
harley.solano@gmail.com hasx1@hotmail.com
Curso de Visual Basic Aplicado Harley Solano Sánchez 12
H
a
‘Conseguir el tamaño del rectángulo dibujado para indicada por la constante DT_CALCRECT r
rt = DrawText(PicScroll.hdc, ScrollText1, -1, DrawingRect, DT_CALCRECT) l
If rt = 0 Then 'err e
MsgBox "Error scrolling text", vbExclamation y
EndingFlag = True
Else S
DrawingRect.Top = PicScroll.ScaleHeight o
DrawingRect.Left = 0 l
DrawingRect.Right = PicScroll.ScaleWidth a
‘Almacenar la altura del rectangulo n
RectHeight = DrawingRect.Bottom o
DrawingRect.Bottom = DrawingRect.Bottom + PicScroll.ScaleHeight
End If *
Do While Not EndingFlag *
If GetTickCount() - LastFrameTime > IntervalTime Then
PicScroll.Cls H
DrawText PicScroll.hdc, ScrollText1, -1, DrawingRect, DT_CENTER Or DT_WORDBREAK a
‘ Actualizar las coordenadas dle rectangulo r
DrawingRect.Top = DrawingRect.Top - 1 l
DrawingRect.Bottom = DrawingRect.Bottom - 1 e
‘ Controlando el desplazamiento y reinicializando si llego al final y
If DrawingRect.Top < -(RectHeight) Then 'tiempo Reset
DrawingRect.Top = PicScroll.ScaleHeight S
DrawingRect.Bottom = RectHeight + PicScroll.ScaleHeight o
End If l
PicScroll.Refresh a
LastFrameTime = GetTickCount() n
End If o
DoEvents
Loop *
Unload Me *
Set Derechos = Nothing
End Sub H
a
Objeto : Formulario Derechos r
Evento : UnLoad l
Código : e
Private Sub Form_Unload(Cancel As Integer) y
EndingFlag = True
End Sub S
o
Objeto : Formulario Derechos l
Evento : Load a
Agregar al Código las siguientes líneas : n
o
PicScroll.ForeColor = &H80FF&
PicScroll.FontSize = 16
harley.solano@gmail.com hasx1@hotmail.com