|
-
Nov 3rd, 2000, 12:16 PM
#1
Thread Starter
Lively Member
Hi guys,
How can I make my form fade-in each time it loads up?
Can someone give me a source code?
The fade-in should be a fade in that you can see the background until the form is fully loaded just like in ActiveSplash.
Thanks!
-
Nov 3rd, 2000, 12:55 PM
#2
Addicted Member
im not sure but i "think" u can only do that in windows 2000 as i said im NOT SURE
*Rudy^
Visual Studio 6 Ent. SP5
Windows 2000 SP4
Windows XP SP1a
-
Nov 3rd, 2000, 01:06 PM
#3
_______
<?>
Not a fade but a nice in and out.
Code:
'implore or explode a form on open or close
'bas module code
Option Explicit
#If Win16 Then
Type RECT
Left As Integer
Top As Integer
Right As Integer
Bottom As Integer
End Type
#Else
Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
#End If
'User and GDI Functions for Explode/Implode to work
#If Win16 Then
Declare Sub GetWindowRect Lib "User" (ByVal hwnd As Integer, lpRect As RECT)
Declare Function GetDC Lib "User" (ByVal hwnd As Integer) As Integer
Declare Function ReleaseDC Lib "User" (ByVal hwnd As Integer, ByVal hdc As Integer) As Integer
Declare Sub SetBkColor Lib "GDI" (ByVal hdc As Integer, ByVal crColor As Long)
Declare Sub Rectangle Lib "GDI" (ByVal hdc As Integer, ByVal X1 As Integer, ByVal Y1 As Integer, ByVal X2 As Integer, ByVal Y2 As Integer)
Declare Function CreateSolidBrush Lib "GDI" (ByVal crColor As Long) As Integer
Declare Function SelectObject Lib "GDI" (ByVal hdc As Integer, ByVal hObject As Integer) As Integer
Declare Sub DeleteObject Lib "GDI" (ByVal hObject As Integer)
#Else
Declare Function GetWindowRect Lib "user32" (ByVal hwnd As Long, lpRect As RECT) As Long
Declare Function GetDC Lib "user32" (ByVal hwnd As Long) As Long
Declare Function ReleaseDC Lib "user32" (ByVal hwnd As Long, ByVal hdc As Long) As Long
Declare Function SetBkColor Lib "gdi32" (ByVal hdc As Long, ByVal crColor As Long) As Long
Declare Function Rectangle Lib "gdi32" (ByVal hdc As Long, ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long) As Long
Declare Function CreateSolidBrush Lib "gdi32" (ByVal crColor As Long) As Long
Declare Function SelectObject Lib "user32" (ByVal hdc As Long, ByVal hObject As Long) As Long
Declare Function DeleteObject Lib "gdi32" (ByVal hObject As Long) As Long
#End If
Sub ExplodeForm(f As Form, Movement As Integer)
Dim myRect As RECT
Dim formWidth%, formHeight%, i%, X%, Y%, Cx%, Cy%
Dim TheScreen As Long
Dim Brush As Long
GetWindowRect f.hwnd, myRect
formWidth = (myRect.Right - myRect.Left)
formHeight = myRect.Bottom - myRect.Top
TheScreen = GetDC(0)
Brush = CreateSolidBrush(f.BackColor)
For i = 1 To Movement
Cx = formWidth * (i / Movement)
Cy = formHeight * (i / Movement)
X = myRect.Left + (formWidth - Cx) / 2
Y = myRect.Top + (formHeight - Cy) / 2
Rectangle TheScreen, X, Y, X + Cx, Y + Cy
Next i
X = ReleaseDC(0, TheScreen)
DeleteObject (Brush)
End Sub
Public Sub ImplodeForm(f As Form, Direction As Integer, Movement As Integer, ModalState As Integer)
Dim myRect As RECT
Dim formWidth%, formHeight%, i%, X%, Y%, Cx%, Cy%
Dim TheScreen As Long
Dim Brush As Long
GetWindowRect f.hwnd, myRect
formWidth = (myRect.Right - myRect.Left)
formHeight = myRect.Bottom - myRect.Top
TheScreen = GetDC(0)
Brush = CreateSolidBrush(f.BackColor)
For i = Movement To 1 Step -1
Cx = formWidth * (i / Movement)
Cy = formHeight * (i / Movement)
X = myRect.Left + (formWidth - Cx) / 2
Y = myRect.Top + (formHeight - Cy) / 2
Rectangle TheScreen, X, Y, X + Cx, Y + Cy
Next i
X = ReleaseDC(0, TheScreen)
DeleteObject (Brush)
End Sub
'<<<<<<<<<<<<<<< Form Code >>>>>>>>>>>>>>>>>>>>>>
'unload event
Call ImplodeForm(Me, 2, 500, 1)
Set Form1 = Nothing
unload me
'load event
Call ExplodeForm(Me, 500)
"A myth is not the succession of individual images,
but an integerated meaningful entity,
reflecting a distinct aspect of the real world."
___ Adolf Jensen
-
Nov 3rd, 2000, 01:17 PM
#4
Fanatic Member
Hi HeSaidJoe, with more than 2000 threads, why aren't you a guru?
-
Nov 3rd, 2000, 01:26 PM
#5
_______
<?>
because I'm <?>

"A myth is not the succession of individual images,
but an integerated meaningful entity,
reflecting a distinct aspect of the real world."
___ Adolf Jensen
-
Nov 3rd, 2000, 01:28 PM
#6
Frenzied Member
Fade in + out and more!!!
Code:
Const AW_HOR_POSITIVE = &H1 'Animates the window from left to right. This flag can be used with roll or slide animation.
Const AW_HOR_NEGATIVE = &H2 'Animates the window from right to left. This flag can be used with roll or slide animation.
Const AW_VER_POSITIVE = &H4 'Animates the window from top to bottom. This flag can be used with roll or slide animation.
Const AW_VER_NEGATIVE = &H8 'Animates the window from bottom to top. This flag can be used with roll or slide animation.
Const AW_CENTER = &H10 'Makes the window appear to collapse inward if AW_HIDE is used or expand outward if the AW_HIDE is not used.
Const AW_HIDE = &H10000 'Hides the window. By default, the window is shown.
Const AW_ACTIVATE = &H20000 'Activates the window.
Const AW_SLIDE = &H40000 'Uses slide animation. By default, roll animation is used.
Const AW_BLEND = &H80000 'Uses a fade effect. This flag can be used only if hwnd is a top-level window.
Private Declare Function AnimateWindow Lib "user32" (ByVal hwnd As Long, ByVal dwTime As Long, ByVal dwFlags As Long) As Boolean
Private Sub Form_Load()
'KPD-Team 1999
'URL: http://www.allapi.net/
'E-Mail: [email protected]
'Set the graphic mode to persistent
Me.AutoRedraw = True
Me.Print "Unload me"
'Animate the window (faded)
AnimateWindow Me.hwnd, 200, AW_BLEND
End Sub
Is supposed to work for win98 and 2k
[Edited by Jop on 11-03-2000 at 01:39 PM]
Jop - validweb.nl
Alcohol doesn't solve any problems, but then again, neither does milk.
-
Nov 3rd, 2000, 01:29 PM
#7
Thread Starter
Lively Member
Thanks!
Thanks man!
you're great.
-
Nov 3rd, 2000, 01:47 PM
#8
_______
<?>
VB^ SP3 Win98...
Just displays a title bar for me(sometimes).
The form never makes it.
"A myth is not the succession of individual images,
but an integerated meaningful entity,
reflecting a distinct aspect of the real world."
___ Adolf Jensen
-
Nov 3rd, 2000, 01:50 PM
#9
Fanatic Member
Unfortunately, this is not available in Windows95...
There should be at least a patch ore something to obtain this nice effects with the older 95 version.
The newer SystemParametersInfp API allows us to change these settings (like shadow mouse cursor in Windows 2K). I wonder if there should be any DLL available to achieve this in Win95...
-
Nov 3rd, 2000, 02:20 PM
#10
Thread Starter
Lively Member
it doesn't work for me..
-
Nov 3rd, 2000, 06:56 PM
#11
Frenzied Member
Anyone with win2k here? It isn't working for me neither, but the sliding effects are...
It's supposed to work with win98 and win2k, but I have win98 and it indeed doesn't work... 
Let's test it on win2k.
Jop - validweb.nl
Alcohol doesn't solve any problems, but then again, neither does milk.
-
Nov 3rd, 2000, 11:48 PM
#12
Hyperactive Member
Take a look at this
http://msdn.microsoft.com/library/techart/layerwin.htm
This is the document that explains the new capabilities of
transparency that W2000 has, and Win98 should have but maybe
is in Win98SE (Second Edition) without the BLEND (The actual
fade parameter of AnimateWindow)
Beside that if any one would like the source code to make a transparent form, just have to ask.
You can send me an email for it and i will send you the complete project.
I didn't make it i just download it from Planet-Source and
the download name is: CODE_UPLOAD1062110122000.zip if you like to look for it by yourself
[email protected]
Saludos...
"Who Dares Wins" - "Quien se Arriesga Gana"
Mail me at: 
-
Nov 14th, 2000, 03:10 AM
#13
Junior Member
Re: Take a look at this
Originally posted by D12Bit
http://msdn.microsoft.com/library/techart/layerwin.htm
This is the document that explains the new capabilities of
transparency that W2000 has, and Win98 should have but maybe
is in Win98SE (Second Edition) without the BLEND (The actual
fade parameter of AnimateWindow)
Beside that if any one would like the source code to make a transparent form, just have to ask.
You can send me an email for it and i will send you the complete project.
I didn't make it i just download it from Planet-Source and
the download name is: CODE_UPLOAD1062110122000.zip if you like to look for it by yourself
[email protected]
Saludos...
I ran across a program that actually has a transparent splash screen. The program is called Font FX put out by Electric Rain. If anyone gets a chance to down this app, the splash screen transparency is what I'm looking to do for my VB class project for the final Project. If anyone can help with this I would greatly appreciate it. If they can make it transparent so can we. HEHEHEHEHEHEHE!!!!!
Free Your Creative Spirit
-----------------------------------
-
Nov 14th, 2000, 07:01 PM
#14
Junior Member
Transparent
Free Your Creative Spirit
-----------------------------------
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|