Foros del Web » Programación para mayores de 30 ;) » .NET »

Aporte: Sacudir ventana tipo Mac OSX

Estas en el tema de Aporte: Sacudir ventana tipo Mac OSX en el foro de .NET en Foros del Web. Que tal: Deseo aportar éste código fuente para crear un bonito efecto para nuestras aplicaciones, en mac osx al iniciar sesión si ingresamos la contraseña ...
  #1 (permalink)  
Antiguo 13/03/2012, 13:04
Avatar de haggenx  
Fecha de Ingreso: febrero-2007
Ubicación: México
Mensajes: 823
Antigüedad: 17 años, 1 mes
Puntos: 24
De acuerdo Aporte: Sacudir ventana tipo Mac OSX

Que tal:

Deseo aportar éste código fuente para crear un bonito efecto para nuestras aplicaciones, en mac osx al iniciar sesión si ingresamos la contraseña incorrecta la ventana de login se sacude, bueno he creado algo similar para nuestras ventanas en vb.net, podemos sacudir la ventana en forma horizontal o vertical y así simular el efecto descrito, espero les guste, saludos:


'#### Purpose: Earth quake in the window!!!!!!!!!!!
'#### Created date: 03/03/2012
'#### Created by username: Juan Manuel Mar Hdz.
'#### Last modified date: 10/03/2012
'#### Last modified username: Juan Manuel Mar Hdz.
'#### Thanks to http://www.forosdelweb.com/wiki/Efec...n_el_navegador
Public Sub drawFxEarthQuakeToWindow(window As Form, direction As Long, Optional times As Long = 3)

Select Case direction

Case 1:
xdirectionearthquake(window, 3)

Case 2:
ydirectionearthquake(window, 3)

Case Else:
xdirectionearthquake(window, 3)

End Select

End Sub

'#### Purpose: Earth quake in the window!!!!!!!!!!!
'#### Created date: 03/03/2012
'#### Created by username: Juan Manuel Mar Hdz.
'#### Last modified date: 10/03/2012
'#### Last modified username: Juan Manuel Mar Hdz.
'#### Inspired in http://www.forosdelweb.com/wiki/Efec...n_el_navegador
'#### Thanks to http://bytes.com/topic/visual-basic-...leep-5-minutes
Private Sub xdirectionearthquake(window As Form, times As Long)

Dim i As Long, j As Long, space As Long = 2, movetimes As Long = 4
Dim winleft As Long, sleeptime As Long = 25

winleft = window.Left

For j = 1 To times - 1

window.Left = winleft

For i = 1 To movetimes

My.Application.DoEvents
window.Left = window.Left + (i * space)
System.Threading.Thread.Sleep(sleeptime)

Next

For i = movetimes To 1 Step -1

My.Application.DoEvents
window.Left = window.Left - (i * space)
System.Threading.Thread.Sleep(sleeptime)

Next

For i = 1 To (-1 * movetimes) Step -1

My.Application.DoEvents
window.Left = window.Left - (i * space)
System.Threading.Thread.Sleep(sleeptime)

Next

For i = (-1 * movetimes) To 1

My.Application.DoEvents
window.Left = window.Left + (i * space)
System.Threading.Thread.Sleep(sleeptime)

Next

Next

End Sub

'#### Purpose: Earth quake in the window!!!!!!!!!!!
'#### Created date: 10/03/2012
'#### Created by username: Juan Manuel Mar Hdz.
'#### Last modified date: 10/03/2012
'#### Last modified username: Juan Manuel Mar Hdz.
'#### Inspired in http://www.forosdelweb.com/wiki/Efec...n_el_navegador
'#### Thanks to http://bytes.com/topic/visual-basic-...leep-5-minutes
Private Sub ydirectionearthquake(window As Form, times As Long)

Dim i As Long, j As Long, space As Long = 2, movetimes As Long = 4
Dim winleft As Long, sleeptime As Long = 25

winleft = window.Top

For j = 1 To times - 1

window.Top = winleft

For i = 1 To movetimes

My.Application.DoEvents
window.Top = window.Top + (i * space)
System.Threading.Thread.Sleep(sleeptime)

Next

For i = movetimes To 1 Step -1

My.Application.DoEvents
window.Top = window.Top - (i * space)
System.Threading.Thread.Sleep(sleeptime)

Next

For i = 1 To (-1 * movetimes) Step -1

My.Application.DoEvents
window.Top = window.Top - (i * space)
System.Threading.Thread.Sleep(sleeptime)

Next

For i = (-1 * movetimes) To 1

My.Application.DoEvents
window.Top = window.Top + (i * space)
System.Threading.Thread.Sleep(sleeptime)

Next

Next

End Sub
  #2 (permalink)  
Antiguo 13/03/2012, 13:17
Avatar de Aquaventus  
Fecha de Ingreso: junio-2010
Ubicación: Lima-Peru , En el alba de la naturaleza
Mensajes: 2.105
Antigüedad: 13 años, 8 meses
Puntos: 267
Respuesta: Aporte: Sacudir ventana tipo Mac OSX

Excelente aporte haggenx. Me parece correcto que hayas colocado las fuentes de donde obtuviste una guia. Gracias por tu colaboración. Saludos!.
__________________
Internet es tener todo el conocimiento global a tu disposición.
Desarrollo de Software - Ejemplos .Net
  #3 (permalink)  
Antiguo 13/03/2012, 15:10
Avatar de haggenx  
Fecha de Ingreso: febrero-2007
Ubicación: México
Mensajes: 823
Antigüedad: 17 años, 1 mes
Puntos: 24
Respuesta: Aporte: Sacudir ventana tipo Mac OSX

que bueno que les es de utilidad
  #4 (permalink)  
Antiguo 16/03/2012, 08:01
Avatar de Carlojas  
Fecha de Ingreso: junio-2007
Ubicación: Shikasta
Mensajes: 1.272
Antigüedad: 16 años, 9 meses
Puntos: 49
Respuesta: Aporte: Sacudir ventana tipo Mac OSX

Excelente el aporte haggenx....




Saludos
__________________
"SELECT * FROM Mujeres WHERE situacion NOT IN ('CASADAS','CON HIJOS','ATORMENTADAS','CUASI-ENNOVIADAS') AND personalidad <> 'INTENSA'"

Etiquetas: efecto, mac, sacudir, terremoto
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta

SíEste tema le ha gustado a 1 personas




La zona horaria es GMT -6. Ahora son las 00:25.