Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Fade In and Fade Out (Vb6, Form)


BoDu
 Share

Recommended Posts

**Fade In/Fade Out**
_Vb6 Form_

client source donwload:  [**FadeIn/FadeOut Source**](http://www.touchofdeathforums.com/smf/index.php?action=dlattach;topic=70789.0;attach=17693)

Hehe i think you will like this:

>! Project:
~~1\. Invisible Form - Done~~
2\. Invisible PictureBox and visible Picture for an nice and cool effect - Working On
>! ScreenShot
>! >! ![](http://img709.imageshack.us/img709/2865/workingon.jpg)

* ~~Fade In - Solved~~
* Fade Out - Working On
* ~~Tutorial - Done 80%~~

Here you got the code progress

> 1\. Make an new mod named "**modTransparent**" and add this:
> ```
> Option Explicit
> '**************************************'
> '**************** BoDu ****************'
> '***********Fade In/Fade Out***********'
> '**************************************'
>
> Private Const GWL_EXSTYLE = (-20)
> Private Const WS_EX_LAYERED = &H80000
> Private Const LWA_ALPHA = &H2
> ' look on the alias to see what this function do "exemple Alias "SetWindowLongA"
> Private Declare Function StabilesteLungimeFereastra Lib "user32" Alias "SetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
> ' same here take a look on the alias
> Private Declare Function StabilesteAtributiiStraturiFereastra Lib "user32" Alias "SetLayeredWindowAttributes" (ByVal hWnd As Long, ByVal crKey As Long, ByVal bAlpha As Byte, ByVal dwFlags As Long) As Long
>
> ' here you got the function that make magic happen :)
> Public Function TransformaSablon(Form As Form, TransLevel As Byte) As Boolean
> StabilesteLungimeFereastra Form.hWnd, GWL_EXSTYLE, WS_EX_LAYERED
> StabilesteAtributiiStraturiFereastra Form.hWnd, 0, TransLevel, LWA_ALPHA
> TransformaSablon = Err.LastDllError = 0
> End Function
>
> '**************************************'
> '**************** BoDu ****************'
> '***********Fade In/Fade Out***********'
> '**************************************'
> ```
> 2\. Add two timers on "frmMenu" and name them "PrimulTimp" and "AlDoileaTimp" and set the Timer interval to 5 on both.
>
> 3\. Open frmMenu and add this:
> ```
> Option Explicit
> '**************************************'
> '**************** BoDu ****************'
> '***********Fade In/Fade Out***********'
> '**************************************'
> Dim TLevel As Integer
>
> Private Sub PrimulTimp_Timer()
>
> TLevel = TLevel + 3 ' set it between 1 and 5 (1 for slow and 5 for fast)
>
> TransformaSablon Me, Val(TLevel)
>
>     If TLevel = 255 Then
>         PrimulTimp.Enabled = False
>     End If
>
> End Sub
>
> Private Sub AlDoileaTimp_Timer()
>
> TLevel = TLevel - 3 ' set it between 1 and 5 (1 for slow and 5 for fast)
>
> TransformaSablon Me, Val(TLevel)
>
>     If TLevel = 3 Then ' set it between 1 and 5 (1 for slow and 5 for fast)
>         Unload Me
>     End If
>    
> End Sub
> '**************************************'
> '**************** BoDu ****************'
> '***********Fade In/Fade Out***********'
> '**************************************'
> ```
> 4\. Replace "Private Sub Form_Load()" with this one:
> ```
> '**************************************'
> '**************** BoDu ****************'
> '***********Fade In/Fade Out***********'
> '**************************************'
> Private Sub Form_Load()
>     Dim tmpTxt As String, tmpArray() As String, i As Long
>    
>         AlDoileaTimp.Enabled = False
>
>     TLevel = 3 ' set it between 1 and 5 (1 for slow and 5 for fast)
>    
>     TransformaSablon Me, Val(TLevel)
>
>     ' If debug mode, handle error then exit out
>     If Options.Debug = 1 Then On Error GoTo errorhandler
>    
>     ' general menu stuff
>     Me.Caption = Options.Game_Name
>    
>     ' load news
>     Open App.Path & "\data files\news.txt" For Input As #1
>         Line Input #1, tmpTxt
>     Close #1
>     ' split breaks
>     tmpArray() = Split(tmpTxt, "
> ")
>     lblNews.Caption = vbNullString
>     For i = 0 To UBound(tmpArray)
>         lblNews.Caption = lblNews.Caption & tmpArray(i) & vbNewLine
>     Next
>
>     ' Load the username + pass
>     txtLUser.text = Trim$(Options.Username)
>     If Options.SavePass = 1 Then
>         txtLPass.text = Trim$(Options.Password)
>         chkPass.Value = Options.SavePass
>     End If
>    
>     ' Error handler
>     Exit Sub
> errorhandler:
>     HandleError "Form_Load", "frmMenu", Err.Number, Err.Description, Err.Source, Err.HelpContext
>     Err.Clear
>     Exit Sub
> End Sub
> '**************************************'
> '**************** BoDu ****************'
> '***********Fade In/Fade Out***********'
> '**************************************'
> ```
> 5\. Save and it should work.

If you don't have access on vb6  or you just don't want to add it by yourself you can download the client source from down here.

Enjoy and use it with pleasure.
Link to comment
Share on other sites

@Sekaru:

> I mean translate it to English so people can understand it and learn from it rather than just copying and pasting.

Ok i posted the code too and added some explication, after i'm figure out how to fade out the client i will do an english version too.
Link to comment
Share on other sites

  • 3 weeks later...
  • 2 weeks later...
  • 2 months later...
  • 1 year later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...