Home‎ > ‎

Efecto Al Abrir Formularios

Option Compare Database
Option Explicit
'***************************************************************
'&                                                            &*
'&                                                            &*
'&                                                            &*
'&                                                            &*
'&               Jefferson Jimenez (JJJT)                     &*
'&                 Cabimas - Venezuela                        &*
'&                    Julio - 2009                            &*
'&                                                            &*
'&                                                            &*
'&                                                            &*
'&                                                            &*
'&                                                            &*
'***************************************************************
'Como hacer para que al abrir y al cerrar nuestros form parezcan desvanecerse
'Primero declaramos las Constantes de Efecto
Const Transp = &H2
Const Oculto = &H10000
Const Efecto = &H80000
'Por aqui le paso la velocidad del Efecto
Const VelOpen As Long = 500
Const VelClose As Long = 700
'Establezco el color del Formulario
Const Color As Long = 12632256
'Establezco la Transparencia del Formulario
Const EfecTrans As Long = 220
'Declaro las funciones del API de Windows
Declare Function JJJTAnimar Lib "user32" Alias "AnimateWindow" _
                                            (ByVal hwnd As Long, _
                                            ByVal dwTime As Long, _
                                            ByVal dwFlags As Long) _
                                            As Long
Declare Function Ventana_JJJT Lib "user32" Alias "GetWindowLongA" _
                                            (ByVal hwnd As Long, _
                                            ByVal nIndex As Long) _
                                            As Long
Declare Function TranVen_JJJT Lib "user32" Alias "SetWindowLongA" _
                                            (ByVal hwnd As Long, _
                                            ByVal nIndex As Long, _
                                            ByVal dwNewLong As Long) _
                                            As Long
Declare Function Accion_JJJT Lib "user32" Alias "SetLayeredWindowAttributes" _
                                            (ByVal hwnd As Long, _
                                            ByVal crKey As Long, _
                                            ByVal bAlpha As Byte, _
                                            ByVal dwFlags As Long) _
                                            As Long
'Creo la Funcion del efecto al abrir
'El Formulario debe tener la Opcion Emergente = Si
Function JJJT_EfectoOpen(frm As Form)
JJJTAnimar frm.hwnd, VelOpen, Efecto
frm.Section(0).BackColor = Color
frm.Modal = True
frm.ShortcutMenu = True
End Function
'Creo la Funcion al cerrar
Function JJJT_EfectoClose(frm As Form)
JJJTAnimar frm.hwnd, VelClose, Oculto Or Efecto
End Function
'Creo la Funcion Transparencia
Function JJJT_Transparencia(frm As Form)
   TranVen_JJJT frm.hwnd, (-20), _
   Ventana_JJJT(frm.hwnd, (-20)) _
   Or &H80000
   Accion_JJJT frm.hwnd, 0, _
   EfecTrans, Transp
End Function
'Creo la Funcion Normal
Function JJJT_Normal(frm As Form)
   TranVen_JJJT frm.hwnd, (-20), _
   Ventana_JJJT(frm.hwnd, (-20)) _
   Or &H80000
   Accion_JJJT frm.hwnd, 0, _
   255, Transp
End Function
'Creo la Funcion CierroTransp
Function JJJT_CierroTransp(frm As Form)
   TranVen_JJJT frm.hwnd, (-20), _
   Ventana_JJJT(frm.hwnd, (-20)) _
   Or &H80000
   Accion_JJJT frm.hwnd, 0, _
   (EfecTrans - 120), Transp
   JJJTAnimar frm.hwnd, 300, _
   Efecto Or Oculto
End Function

SelectionFile type iconFile nameDescriptionSizeRevisionTimeUser
ċ

Descargar
Descargue el Ejemplo  37 kb v. 3 13 sept. 2009 18:38 Jefferson Jimenez
ċ

Ver
  15 jul. 2009 19:32 Jefferson Jimenez
Comments