Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Formulario 'Fantasma'
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00872104
Message ID:
00872140
Views:
18
This message has been marked as the solution to the initial question of the thread.
Hola, Mauricio.

>Existe la posibilidad de hacer un formulario fantasma en VFP 8.0 ?
>Es decir, un formulario que valla apareciendo poco a poco hasta llegar a su forma real de diseño, luego, al cerralo, que se valla desapareciendo poco a poco.
*** ------------------------- Form Init
with thisform
  
   doDefault()
   
   * Only for top-level forms
   If .ShowWindow = 2
      
      * Win2000 and up
      If Val( Os(3) ) >= 5
         DECLARE SetWindowLong IN Win32Api INTEGER, INTEGER, INTEGER
         DECLARE SetLayeredWindowAttributes IN Win32Api INTEGER, STRING, INTEGER, INTEGER
         DECLARE GetWindowLong IN Win32Api INTEGER, INTEGER
      EndIf
      
      If .visible
         .Show()
      EndIf 
   EndIf
   
EndWith 

*** ------------------------- Form Show
LPARAMETERS nStyle

* Invisible
this.Fade( 0 )

this.Visible = .t.

* Fade IN
this.Fade( +1 )

*** ------------------------- Form Hide
DoDefault()

* Fade OUT
this.Fade( -1 )

*** ------------------------- Form Destroy
With this
   DoDefault()
   
   If .Visible and .ShowWindow = 2
      .Fade( -1 )
   EndIf
endwith


*** ------------------------- Form Fade (custom method)
Lparameters tnMode as Number && +1 fade in, -1 fade out, 0 invisible

With thisform
   
   * For Top-level form on Win2000 and up
   If .ShowWindow = 2 and Val( Os(3) ) >= 5

      DECLARE Sleep IN Win32API INTEGER nMilliseconds

      If Empty( tnMode )
         
         SetWindowLong( .hWnd, -20, 0x00080000 )
         SetLayeredWindowAttributes( .hWnd, 0, 0, 2 )
      Else
         Local lnOpacity, lnFrom, lnTo, lnStep
         lnFrom = Iif( tnMode > 0, 0, 255 )
         lnTo   = Iif( tnMode > 0, 255, 0 )
         lnStep = tnMode * 25
         
         * Fade IN/OUT
         for lnOpacity = lnFrom to lnTo step lnStep

            Sleep( 100 )            
            
            SetWindowLong( .hWnd, -20, 0x00080000 )
            SetLayeredWindowAttributes( .hWnd, 0, lnOpacity, 2 )
         Next

         SetWindowLong( .hWnd, -20, 0x00080000 )
         SetLayeredWindowAttributes( .hWnd, 0, lnTo, 2 )
      EndIf
   endif
endwith
Espero que te sirva.

Saludos,
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform