border

Miembros:
Mensajes:
Temas:
Online:

Ultimo Miembro:

 
 

Cuenta Bancaria en EEUU

Retroceder   VB-MUNDO - Programacion Visual > Programacion - Lenguajes > Visual Basic 6.00
Registrarse FAQ Miembros Calendario Buscar Temas de Hoy Marcar Foros Como Leídos

Respuesta
 
LinkBack Herramientas Desplegado
  #1 (permalink)  
Antiguo 02-02-2007, 17:07:50
Avatar de Korku
Usuario VIP del Foro
 
Registrado: feb 2005
Ubicación: España
Posts: 632
Korku Aun no valorado
Contactar con Korku a través de ICQ Enviar un mensaje a través de AIM a Korku Contactar con Korku a través de MSN Contactar con Korku a través de Yahoo Send a message via Skype™ to Korku
Predeterminado Efecto "Explosión" Formulario Estilo Windows Vista

Hola forer@s,

Aquí muestro el código fuente al abrir un formulario con efecto "Explosión", típico del Windows Vista:









Código:
Option Explicit

Private Sub EfectoExplosion(ByRef frmFormulario As Form)
  Dim lngA As Long
  
  With frmFormulario
    .Width = 0
    .Height = 0
    .Show
   
    For lngA = 0 To 10000 Step 50
      .Move (Screen.Width - .Width) / 2, (Screen.Height - .Height) / 2, lngA, lngA
      DoEvents
    Next lngA
    
    End With
  
End Sub

Private Sub Form_Load()
    EfectoExplosion Me
End Sub
¿Qué os parece? Sé que se puede mejorarlo, por ejemplo que el formulario que abra en Modal

Un saludo :-)
Responder Con Cita
  #2 (permalink)  
Antiguo 02-02-2007, 17:33:51
Avatar de malm82
Gran Participación en el Foro
 
Registrado: dic 2006
Ubicación: Cancun,Quintana Roo
Posts: 176
malm82 Valoración +2
Predeterminado

Hola a todos aqui les pongo un codigo que encontre en la web que sirve para ponerle un efecto al cerrar un formulario.

esto lo colocan en un modulo
Código:
Option Explicit

Private Const MODULE_NAME As String = "mdEfectos"

Type RECT
    left As Long
    top As Long
    right As Long
    bottom As Long
End Type

' x, y, nWidth, nHeight in pixels
Declare Function MoveWindow Lib "user32.dll" (ByVal hwnd As Long, ByVal x As Long, _
        ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, _
        ByVal bRepaint As Long) As Long

Declare Function GetWindowRect Lib "user32.dll" (ByVal hwnd As Long, lpRect As RECT) As Long

Public Sub WipeEffect(frm As Form, lngOpt As Long, lngIncrement As Long)
On Error GoTo WipeEffect_Error

    Dim r As RECT
    Dim lngRet As Long
    Dim lngX As Long
    Dim lngFormHeight As Long
    Dim lngFormWidth As Long
    Dim lngIncrementW As Long
    Dim lngIncrementH As Long
        
    lngRet = GetWindowRect(frm.hwnd, r)
    lngFormWidth = r.right - r.left
    lngFormHeight = r.bottom - r.top
        
    lngIncrementW = lngFormWidth \ lngIncrement
    lngIncrementH = lngFormHeight \ lngIncrement
    
    Select Case lngOpt
        Case 1 ' wipe up
            For lngX = 1 To lngIncrement
                lngRet = MoveWindow(frm.hwnd, r.left, r.top, _
                lngFormWidth, lngFormHeight - lngX * lngIncrementH, 1)
            Next lngX
        Case 2 ' wipe down
            For lngX = 1 To lngIncrement
                lngRet = MoveWindow(frm.hwnd, r.left, r.top + lngX * lngIncrementH, _
                lngFormWidth, lngFormHeight - lngX * lngIncrementH, 1)
            Next lngX
        Case 3 ' wipe right
            For lngX = 1 To lngIncrement
                lngRet = MoveWindow(frm.hwnd, r.left + lngX * lngIncrementW, r.top, _
                lngFormWidth - lngX * lngIncrementW, lngFormHeight, 1)
            Next lngX
        Case 4 ' wipe left
            For lngX = 1 To lngIncrement
                lngRet = MoveWindow(frm.hwnd, r.left, r.top, _
                lngFormWidth - lngX * lngIncrementW, lngFormHeight, 1)
            Next lngX
        Case 5 ' shrink/move
            For lngX = 1 To lngIncrement
                lngRet = MoveWindow(frm.hwnd, r.left - lngX * lngIncrementW, _
                r.top + lngX * lngIncrementH, _
                lngFormWidth - lngX * lngIncrementW, _
                lngFormHeight - lngX * lngIncrementH, 1)
            Next lngX
        Case Else ' shiver
            Dim lngTop As Long
            Dim lngLeft As Long
            Dim factor As Long
            factor = 30
            For lngX = 1 To 2500
                If lngX Mod 4 = 0 Then
                    lngLeft = r.left - factor
                    lngTop = r.top - factor
                ElseIf lngX Mod 3 = 0 Then
                    lngLeft = r.left - factor
                    lngTop = r.top + factor
                ElseIf lngX Mod 2 = 0 Then
                    lngLeft = r.left + factor
                    lngTop = r.top - factor
                Else
                    lngLeft = r.left + factor
                    lngTop = r.top + factor
                End If
                lngRet = MoveWindow(frm.hwnd, _
                lngLeft, _
                lngTop, _
                lngFormWidth, _
                lngFormHeight, 1)
            Next lngX
            MsgBox "Error.", vbCritical, "Code"
    End Select
    
WipeEffect_Done:
    Exit Sub

WipeEffect_Error:
    'Call SysException.error(MODULE_NAME, "WipeEffect")
    Resume WipeEffect_Done
End Sub
Esto va en el boton de cerrar el formulario para llamar al funcion
Código:
Private Sub cmdSalir_Click()
    Dim lngOpt As Long
    Dim lngIncrement As Long
    'para que el efecto sea diferente
    lngOpt = Int(Rnd * 5) + 1
    If lngOpt >= 0 Then
        'velocidad del efecto
        lngIncrement = 100
        Call WipeEffect(Me, lngOpt, lngIncrement)
    End If
    Unload Me
End Sub
saludos desde cancun espero y les guste y el saquen provecho para obtener aplicaciones muy atractivas.
__________________
Saludos desde Cancùn...
Alex malm
Código:
Pienso primero luego programo
Responder Con Cita
Respuesta


Herramientas
Desplegado

Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Trackbacks are habilitado
Pingbacks are habilitado
Refbacks are habilitado


Temas Similares
Tema Autor Foro Respuestas Último Mensaje
proyecto "spider bot" o "rastreador web" KUSFLO Visual Basic.NET 2003 & 2005 0 11-09-2006 10:55:19
usar "enter" en vez de "tab" en DTPicker Eynar Visual Basic 6.00 2 05-09-2006 17:46:56
usar tecla "enter" en vez de "tab" Eynar Visual Basic 6.00 6 13-06-2006 15:03:51
Error authentication mode="Windows" chichi60 Visual Basic.NET 2003 & 2005 0 27-04-2006 03:14:29
¿Cómo deshabilitar tecla "Windows" (ventanita)? lindochico Visual Basic 6.00 1 06-06-2005 10:03:05


La franja horaria es GMT. Ahora son las 04:08:08.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO 3.1.0
A vBSkinworks Design

Alojado en el servicio Premium de Masquewebs | Diseño mejorado por MasqueWebs

right