AC_Alberta
New member
- Local time
- Today, 00:28
- Joined
- Mar 31, 2025
- Messages
- 9
Hi, I'm after some help in getting the above to work..
Have no problem with parent forms fading in and out using the following:
Public FF1, FF2, FF3 As Long
FF1 = GetWindowLong(MyForm1.hWnd, GWL_EXSTYLE)
FF1 = FF1 Or WS_EX_LAYERED
SetWindowLong MyForm1.hWnd, GWL_EXSTYLE, FF1
SetWindowOpacity MyForm1.hWnd, 0, 0, LWA_ALPHA
MyForm1.Visible = True
Forms(Str1).Modal = True
For FF2 = 0 To 255 Step 10
SetWindowOpacity MyForm1.hWnd, 0, FF2, LWA_ALPHA
Sleep 2
DoEvents
Next FF2
FF1 = GetWindowLong(MyForm2.hWnd, GWL_EXSTYLE)
FF1 = FF1 Or WS_EX_LAYERED
SetWindowLong MyForm2.hWnd, GWL_EXSTYLE, FF1
SetWindowOpacity MyForm2.hWnd, 0, 0, LWA_ALPHA
For FF3 = 255 To 0 Step -10
SetWindowOpacity MyForm2.hWnd, 0, FF3, LWA_ALPHA
Sleep 2
DoEvents
Next FF3
However when it comes to two child forms overlayed and embedded in the parent form, with one visible = True and one one visible = False I get Error 438, Object doesn't support this property or method.
I can get them to work by toggling the visible property on each but I'm really after the fade effect.
Is there any other method or coding that will work for sub forms or do I have to suck it up?
Any suggestions would be appreciated.
PS - The coding above goes over my head, I just know it works.
Andy
Have no problem with parent forms fading in and out using the following:
Public FF1, FF2, FF3 As Long
FF1 = GetWindowLong(MyForm1.hWnd, GWL_EXSTYLE)
FF1 = FF1 Or WS_EX_LAYERED
SetWindowLong MyForm1.hWnd, GWL_EXSTYLE, FF1
SetWindowOpacity MyForm1.hWnd, 0, 0, LWA_ALPHA
MyForm1.Visible = True
Forms(Str1).Modal = True
For FF2 = 0 To 255 Step 10
SetWindowOpacity MyForm1.hWnd, 0, FF2, LWA_ALPHA
Sleep 2
DoEvents
Next FF2
FF1 = GetWindowLong(MyForm2.hWnd, GWL_EXSTYLE)
FF1 = FF1 Or WS_EX_LAYERED
SetWindowLong MyForm2.hWnd, GWL_EXSTYLE, FF1
SetWindowOpacity MyForm2.hWnd, 0, 0, LWA_ALPHA
For FF3 = 255 To 0 Step -10
SetWindowOpacity MyForm2.hWnd, 0, FF3, LWA_ALPHA
Sleep 2
DoEvents
Next FF3
However when it comes to two child forms overlayed and embedded in the parent form, with one visible = True and one one visible = False I get Error 438, Object doesn't support this property or method.
I can get them to work by toggling the visible property on each but I'm really after the fade effect.
Is there any other method or coding that will work for sub forms or do I have to suck it up?
Any suggestions would be appreciated.
PS - The coding above goes over my head, I just know it works.
Andy