Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Is there a code that makes a form invisible while making it transparent slowly..............? And : A code for Fading/Changing Colors on Form.............? -- helmekki ------------------------------------------------------------------------ helmekki's Profile: http://www.excelforum.com/member.php...fo&userid=6939 View this thread: http://www.excelforum.com/showthread...hreadid=485054 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Helmekki,
See xlDynamic at: http://www.xldynamic.com/source/xld.xlFAQ0007.html --- Regards, Norman "helmekki" wrote in message ... Is there a code that makes a form invisible while making it transparent slowly..............? And : A code for Fading/Changing Colors on Form.............? -- helmekki ------------------------------------------------------------------------ helmekki's Profile: http://www.excelforum.com/member.php...fo&userid=6939 View this thread: http://www.excelforum.com/showthread...hreadid=485054 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I don't think think Norman's link shows actual fading. Here's how you do
it: In the userform's module: Private Sub UserForm_Initialize() hWndDirects = 0 End Sub Private Sub CommandButton1_Click() Dim Counter As Integer Dim Counter2 As Long For Counter = 255 To 1 Step -1 SetUFOpacity Me, CByte(Counter) For Counter2 = 1 To 500 ''Delay loop DoEvents Next Next Unload Me End Sub And in a regular module: Declare Function FindWindow Lib "user32" Alias _ "FindWindowA" (ByVal lpClassName As String, _ ByVal lpWindowName As String) As Long Declare Function GetWindowLong Lib "user32" Alias _ "GetWindowLongA" (ByVal hWnd As Long, _ ByVal nIndex As Long) As Long Declare Function SetWindowLong Lib "user32" Alias _ "SetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long, _ ByVal dwNewLong As Long) As Long Declare Function SetLayeredWindowAttributes Lib "user32" _ (ByVal hWnd As Long, ByVal crey As Byte, _ ByVal bAlpha As Byte, ByVal dwFlags As Long) As Long Const GWL_EXSTYLE = (-20) Const WS_EX_LAYERED = &H80000 Const LWA_ALPHA = &H2& Public hWndDirects As Long Sub SetUFOpacity(Frm As UserForm, Alpha As Byte) With Frm If hWndDirects = 0 Then hWndDirects = FindWindow("ThunderDFrame", .Caption) SetWindowLong hWndDirects, GWL_EXSTYLE, _ GetWindowLong(hWndDirects, GWL_EXSTYLE) Or WS_EX_LAYERED End If SetLayeredWindowAttributes hWndDirects, 0, Alpha, LWA_ALPHA End With End Sub -- Jim "helmekki" wrote in message ... | | Is there a code that makes a form invisible while making it transparent | slowly..............? | | And : | | A code for Fading/Changing Colors on Form.............? | | | -- | helmekki | | | ------------------------------------------------------------------------ | helmekki's Profile: http://www.excelforum.com/member.php...fo&userid=6939 | View this thread: http://www.excelforum.com/showthread...hreadid=485054 | |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
For any W98 users-
The SetLayeredWindowAttributes API was introduced in W2000, trying to call it in W98 would not only crash XL but probably windows. Regards, Peter T "Jim Rech" wrote in message ... I don't think think Norman's link shows actual fading. Here's how you do it: In the userform's module: Private Sub UserForm_Initialize() hWndDirects = 0 End Sub Private Sub CommandButton1_Click() Dim Counter As Integer Dim Counter2 As Long For Counter = 255 To 1 Step -1 SetUFOpacity Me, CByte(Counter) For Counter2 = 1 To 500 ''Delay loop DoEvents Next Next Unload Me End Sub And in a regular module: Declare Function FindWindow Lib "user32" Alias _ "FindWindowA" (ByVal lpClassName As String, _ ByVal lpWindowName As String) As Long Declare Function GetWindowLong Lib "user32" Alias _ "GetWindowLongA" (ByVal hWnd As Long, _ ByVal nIndex As Long) As Long Declare Function SetWindowLong Lib "user32" Alias _ "SetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long, _ ByVal dwNewLong As Long) As Long Declare Function SetLayeredWindowAttributes Lib "user32" _ (ByVal hWnd As Long, ByVal crey As Byte, _ ByVal bAlpha As Byte, ByVal dwFlags As Long) As Long Const GWL_EXSTYLE = (-20) Const WS_EX_LAYERED = &H80000 Const LWA_ALPHA = &H2& Public hWndDirects As Long Sub SetUFOpacity(Frm As UserForm, Alpha As Byte) With Frm If hWndDirects = 0 Then hWndDirects = FindWindow("ThunderDFrame", .Caption) SetWindowLong hWndDirects, GWL_EXSTYLE, _ GetWindowLong(hWndDirects, GWL_EXSTYLE) Or WS_EX_LAYERED End If SetLayeredWindowAttributes hWndDirects, 0, Alpha, LWA_ALPHA End With End Sub -- Jim "helmekki" wrote in message ... | | Is there a code that makes a form invisible while making it transparent | slowly..............? | | And : | | A code for Fading/Changing Colors on Form.............? | | | -- | helmekki | | | ------------------------------------------------------------------------ | helmekki's Profile: http://www.excelforum.com/member.php...fo&userid=6939 | View this thread: http://www.excelforum.com/showthread...hreadid=485054 | |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Jim,
Thank you for the correction. I thought that the xlDynamic site had a downloadable example of a fading form, but I can no longer find it In any event, the link I gave relates to a timed splash screen without the rquired fade. Thank you also for your code. --- Regards, Norman "Jim Rech" wrote in message ... I don't think think Norman's link shows actual fading. Here's how you do it: In the userform's module: Private Sub UserForm_Initialize() hWndDirects = 0 End Sub Private Sub CommandButton1_Click() Dim Counter As Integer Dim Counter2 As Long For Counter = 255 To 1 Step -1 SetUFOpacity Me, CByte(Counter) For Counter2 = 1 To 500 ''Delay loop DoEvents Next Next Unload Me End Sub And in a regular module: Declare Function FindWindow Lib "user32" Alias _ "FindWindowA" (ByVal lpClassName As String, _ ByVal lpWindowName As String) As Long Declare Function GetWindowLong Lib "user32" Alias _ "GetWindowLongA" (ByVal hWnd As Long, _ ByVal nIndex As Long) As Long Declare Function SetWindowLong Lib "user32" Alias _ "SetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long, _ ByVal dwNewLong As Long) As Long Declare Function SetLayeredWindowAttributes Lib "user32" _ (ByVal hWnd As Long, ByVal crey As Byte, _ ByVal bAlpha As Byte, ByVal dwFlags As Long) As Long Const GWL_EXSTYLE = (-20) Const WS_EX_LAYERED = &H80000 Const LWA_ALPHA = &H2& Public hWndDirects As Long Sub SetUFOpacity(Frm As UserForm, Alpha As Byte) With Frm If hWndDirects = 0 Then hWndDirects = FindWindow("ThunderDFrame", .Caption) SetWindowLong hWndDirects, GWL_EXSTYLE, _ GetWindowLong(hWndDirects, GWL_EXSTYLE) Or WS_EX_LAYERED End If SetLayeredWindowAttributes hWndDirects, 0, Alpha, LWA_ALPHA End With End Sub -- Jim |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Printing a color document - color is fading | Excel Discussion (Misc queries) | |||
Blinking/Fading Message Box. | Excel Discussion (Misc queries) | |||
How do I have data bars WITHOUT the clour fading to the right? | Excel Discussion (Misc queries) | |||
Strange issue freezing parent form when unloading a child form | Excel Programming | |||
Is it possible to open the VBA form with a link in a sheet and to pass variable from a cell to the VBA form? | Excel Programming |