Form Fade in/out

SPN_X

Mitglied
Hey,
ich habe jetzt schon überall gesucht aber nicht das gefunden was ich brauche.
Es gab immer nur sowas mit einem Slider aber das möchte ich nicht.

Mein vorhaben:
Ich möchte das mein Programm wenn ich es starte nicht einfach auftaucht sondern langsam erscheint (also fade in) und wenn ich es schließe nicht einfach verschwindet sonder immer blasser wird (fade out).

Kann mir da jemand mit nem link oder code weiterhelfen

THX schnmal
 
Danke, das war es was ich wollte nur ein prob hab ich damit noch...
Ich weiß nicht wie ich die geschwindigkeit beim Fade in und out langsamener machen kann:
Code:
Public Sub Form_FadeIn(ByVal hWnd As Long, Optional ByVal iStep As Integer = 1)
'Form einblenden
  Dim iAlpha As Integer

    For iAlpha = 0 To 255 Step iStep
        SetLayeredWindowAttributes hWnd, 0, iAlpha, LWA_ALPHA
        DoEvents
    Next
End Sub

Public Sub Form_SetAlphaValue(ByVal hWnd As Long, ByVal bAlpha As Byte)
'Transparenzwert (Alpha-Wert) setzen
    SetLayeredWindowAttributes hWnd, 0, bAlpha, LWA_ALPHA
End Sub

Private Declare Function SetLayeredWindowAttributes Lib _
      "user32.dll" (ByVal hWnd As Long, ByVal crKey As Long, _
      ByVal bAlpha As Byte, ByVal dwFlags As Long) As Long

'++++++++++++++++++++++++

Private Sub Form_Load()
    Form_SetStyle Me.hWnd   'Fensterstil ändern
    Me.Visible = True       'Form sichtbar machen
    Form_FadeIn Me.hWnd, 1  'Form einblenden
End Sub
 
Zurück