Hacer que el Form tiemble

Iniciado por Hurubnar, 7 Enero 2011, 19:22 PM

0 Miembros y 1 Visitante están viendo este tema.

Hurubnar

Esta opción hace que el form tiemble durante 5 segundos. Se necesitan dos timers.

Código (vb) [Seleccionar]
Dim cuenta As Integer
Dim re As Boolean
Private Declare Function FlashWindow Lib "user32" (ByVal hwnd As Long, ByVal bInvert As Long) As Long


Timer1
Código (vb) [Seleccionar]
If cuenta = 5 Then
    cuenta = 0
    Timer1.Enabled = False
    Timer2.Enabled = False
Else
    FlashWindow Form1.hwnd, 1
    cuenta = cuenta + 1
End If


Timer2
Código (vb) [Seleccionar]
If re = False Then
    Form1.Top = Form1.Top + 100
    Form1.Left = Form1.Left + 100
    re = True
Else
    Form1.Top = Form1.Top - 100
    Form1.Left = Form1.Left - 100
    re = False
End If


Llamada
Código (vb) [Seleccionar]
Timer1.Interval = 1000
Timer1.Enabled = True
Timer2.Interval = 50
Timer2.Enabled = True
re = False


Fuente
Un saludo