please help me find out.. i have tried to reverse enginere the fade out code but it just isnt working
thanks
3 1058
please help me find out.. i have tried to reverse enginere the fade out code but it just isnt working
I'd suggest you take some time to play with it and understand how it works. I've just had a quick play and was able to get it to fade in. You just have to make sure you reverse the starting and ending conditions, and the "- 25".
please help me find out.. i have tried to reverse enginere the fade out code but it just isnt working
thanks
I have made fade in and out effects to my form.
use this code. add a timer name tmr - Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" _
-
(ByVal hwnd As Long, ByVal nIndex As Long) As Long
-
Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" _
-
(ByVal hwnd As Long, ByVal nIndex As Long, _
-
ByVal dwNewLong As Long) As Long
-
Private Const GWL_STYLE = (-16)
-
Private Const GWL_EXSTYLE = (-20)
-
Private Declare Function SetLayeredWindowAttributes Lib "user32" _
-
(ByVal hwnd As Long, ByVal crKey As Long, _
-
ByVal bAlpha As Byte, ByVal dwFlags As Long) As Long
-
Private Const LWA_COLORKEY = &H1
-
Private Const LWA_ALPHA = &H2
-
Private Const WS_EX_LAYERED = &H80000
-
-
-
Private m_lAlpha As Long
-
-
Dim lStyle As Long
-
Dim lAlpha
-
-
-
-
Private Sub Form_Load()
-
-
m_lAlpha = 255
-
-
If (m_lAlpha = 255) Then
-
-
lStyle = GetWindowLong(Me.hwnd, GWL_EXSTYLE)
-
lStyle = lStyle Or WS_EX_LAYERED
-
SetWindowLong Me.hwnd, GWL_EXSTYLE, lStyle
-
End If
-
-
m_lAlpha = m_lAlpha - 255
-
lAlpha = m_lAlpha
-
If (lAlpha < 0) Then
-
lAlpha = 0
-
End If
-
-
end sub
-
-
Private Sub tmr_Timer()
-
-
If (m_lAlpha = 255) Then
-
-
lStyle = GetWindowLong(Me.hwnd, GWL_EXSTYLE)
-
lStyle = lStyle Or WS_EX_LAYERED
-
SetWindowLong Me.hwnd, GWL_EXSTYLE, lStyle
-
End If
-
-
m_lAlpha = m_lAlpha + 25
-
lAlpha = m_lAlpha
-
If (lAlpha > 150) Then
-
lAlpha = 150
-
End If
-
SetLayeredWindowAttributes Me.hwnd, 150, lAlpha, LWA_ALPHA
-
If (m_lAlpha > 150) Then
-
m_lAlpha = 150
-
tmr.Enabled = False
-
End If
-
End If
-
-
End Sub
-
-
Set timer interval to 40 and play the form When you play the form there is a transperancy in form if you dont want this in timer code replace 150 to 255
hannibaal, if you have a look at Ali's other thread in the Articles area, I've added an example which shows both fade in and out effects when you click buttons. It also includes some comments, and I tried to simplify the code down to the bare minimum.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Robert Skidmore |
last post by:
I am building an application that will fade one panel to another
panel. Both panels will have picture boxes in them (thumbnails).
This is what I have tried:
private void...
|
by: Robert Skidmore |
last post by:
I am building an application that will fade one panel to another
panel. Both panels will have picture boxes in them (thumbnails).
This is what I have tried:
private void...
|
by: Cylix |
last post by:
I have a form with a irregular background image, let say a circle.
I would like the form shows and that fade out and close slowly.
I have already done the fade out part by the timmer to set the...
|
by: tristanlbailey |
last post by:
I have been attempting to solve this problem for a few weeks now, but I'm not having much luck...
I would like to create a seamless fading effect on each form/window in my program; one that, when...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
| |