Results 1 to 2 of 2

Thread: fade effects linke winxp

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Mar 2009
    Location
    vbforums
    Posts
    809

    fade effects linke winxp

    how to achieve fade effects like winxp shutdown confirmation window for an application in vb6.

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: fade effects linke winxp

    Here is something you can play with
    vb Code:
    1. 'Place this in the declarations section of the Form
    2. 'Replace FormName with the Key that you want the registry
    3. 'Settings stored under
    4.  
    5. Private Sub FadeScreen(TheForm As Form, WhichWay As String)
    6.        
    7.         Dim TheVerticalSize As Single
    8.         Dim TheHorizontalSize As Single
    9.         Dim MoveMeToTheRight As Single
    10.         Dim MoveMyTop As Single
    11.         Dim i As Integer
    12.         Const TheStep = 1000
    13.        
    14.         TheVerticalSize = TheForm.Width / TheStep
    15.        
    16.         Select Case UCase(WhichWay)
    17.           Case "TR"
    18.             'fade to top right                '
    19.             MoveMeToTheRight = TheForm.Height / TheStep
    20.             TheHorizontalSize = MoveMeToTheRight
    21.           Case "BL"
    22.             'fade to bottom left
    23.             MoveMyTop = TheForm.Height / TheStep
    24.             TheVerticalSize = MoveMyTop
    25.             TheHorizontalSize = TheForm.Height / TheStep
    26.           Case "BR"
    27.             'fade to bottom right
    28.             MoveMyTop = TheForm.Height / TheStep
    29.             TheVerticalSize = MoveMyTop
    30.             MoveMeToTheRight = TheForm.Height / TheStep
    31.             TheHorizontalSize = TheForm.Height / TheStep
    32.           Case Else
    33.             'default to top left if you put something else in
    34.             TheHorizontalSize = TheForm.Height / TheStep 'size of horizontal steps
    35.         End Select
    36.        SaveSetting "FormName", "Unload Screen", "Direction", WhichWay
    37.         For i = 1 To TheStep - 1
    38.             TheForm.Move TheForm.Left + MoveMeToTheRight, TheForm.Top + MoveMyTop, _
    39.             TheForm.Width - TheHorizontalSize, TheForm.Height - TheVerticalSize
    40.         Next
    41.        
    42.         Unload Me
    43.        
    44.     End Sub
    45.  
    46. Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
    47. Dim Regsetting As String
    48. Dim NewDirection As String
    49. Regsetting = GetSetting("FormName", "Unload Screen", "Direction")
    50.         If Regsetting = "" Then
    51.            FadeScreen Me, "BR"
    52.            Exit Sub
    53.         Else
    54.           Select Case Regsetting
    55.             Case "BR"
    56.               NewDirection = "BL"
    57.             Case "BL"
    58.               NewDirection = "TR"
    59.             Case "TR"
    60.               NewDirection = "BR"
    61.           End Select
    62.         End If
    63.         FadeScreen Me, NewDirection
    64. End Sub

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width