UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
2 Pages V  1 2 >  (Go to first unread post)
   Reply to this topicStart new topic
> ACC2000: Translucent Forms    
 
   
Dom DXecutioner
post Jan 18 2007, 01:25 PM
Post#1



Posts: 1,155
Joined: 18-November 03
From: California


Greetings,
ttached is a sample on how to use transparency on Access forms. The sample contains three functions and it's important to note that the PopUp property of the form must be set to YES or this will NOT work...
SetTranslucent(hWnd As Long, Opacity As Integer)
UIProcessFadeIn(UIForm As Form, Optional EndOpacity As Integer = 255)
UIProcessFadeOut(UIForm As Form, Optional StartOpacity As Integer = 255)
HAs usual, exersice extreme caution when using API's... Some error trapping may be necessary, but not required.
Have fun.
Xy
Attached File(s)
Attached File  ACC2000.TranslucentForms.zip ( 44.92K )Number of downloads: 768
 
Go to the top of the page
 
doctor9
post Jan 18 2007, 02:25 PM
Post#2


UtterAccess Editor
Posts: 17,924
Joined: 29-March 05
From: Wisconsin


Wow, that's sexy.
If I combine this with Shaped Forms (found at the Access Web, I should be able to come up with a spooky looking April Fool's prank...
Mwahahaha!!
Dennis
Go to the top of the page
 
Dom DXecutioner
post Jan 18 2007, 03:02 PM
Post#3



Posts: 1,155
Joined: 18-November 03
From: California


You could also use ACC2000: Custom Shaped Forms
Go to the top of the page
 
cheekybuddha
post Jan 18 2007, 03:16 PM
Post#4


UtterAccess VIP
Posts: 9,277
Joined: 6-December 03
From: Telegraph Hill


Nice to see you after a long while Xy. -o!
hrisO posted something similar to the Code Archive a short while back.
I had fun passing the Access.HwndApp to the function and making the application window but it had some bad side effects (the database window would flicker when moved after restoring the application window).
Have you worked out a way to apply this to subforms? It would be good to get a subform's hwnd and apply it, but how to deal with the popup requirement?
Regards,
d
Go to the top of the page
 
BlueTick
post Jan 18 2007, 03:27 PM
Post#5



Posts: 107
Joined: 2-May 05



Welcome back Xy, your skills were truly missed.
l'Blue
Go to the top of the page
 
CyberCow
post Jan 18 2007, 03:28 PM
Post#6


UdderAccess Admin + UA Ruler
Posts: 19,555
Joined: 27-April 02
From: Upper MI


What I like about your demo Xy is that it has an extremely small code footprint. Plus, it converted to A97 with NO problems at all.
Is there a way to set the fade in/out time?
Cool dood!
Go to the top of the page
 
Dom DXecutioner
post Jan 18 2007, 03:28 PM
Post#7



Posts: 1,155
Joined: 18-November 03
From: California


Hello and thank you,
My apologies for the thread, i did not realize this code had already been posted.
HAs for the subform... i assume you mean making the subform transparent and the parent form normal. I'm not sure that could be accomplished, but i'd imagined using some subclassing techniques along with other API's would probably be required. If at all possible.
However, because access forms are created dynamically and act different than VB forms, the results would be unpleasant, not to mention the amount of code needed to subclass the subform.
I see very little benefit using this technique and would not recommend it.
Go to the top of the page
 
CyberCow
post Jan 18 2007, 03:31 PM
Post#8


UdderAccess Admin + UA Ruler
Posts: 19,555
Joined: 27-April 02
From: Upper MI


Dennis,
I was thinking of placing modified versions of this in our main app and have it trigger different ways depending on who logs in. Not spooky, but could be extremely funny . . .
Go to the top of the page
 
Dom DXecutioner
post Jan 18 2007, 03:32 PM
Post#9



Posts: 1,155
Joined: 18-November 03
From: California


Cyber,
Can you elaborate on what you mean by "Is there a way to set the fade in/out time?" Do you mean the speed?
Go to the top of the page
 
CyberCow
post Jan 18 2007, 03:36 PM
Post#10


UdderAccess Admin + UA Ruler
Posts: 19,555
Joined: 27-April 02
From: Upper MI


Xy, yeah, the speed at which a fade occurs.
Go to the top of the page
 
Dom DXecutioner
post Jan 18 2007, 03:45 PM
Post#11



Posts: 1,155
Joined: 18-November 03
From: California


Cyber,

You could modified the code as follows...

CODE
[color="green"]'// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
// PURPOSE:    process fade in effect on any particular form. the form's
'//             POPUP property must be set to YES or this will not work
'// PARAMETERS: [in] UIForm - the form we want to fade in
'//             [in] EndOpacity - the final opacity value in which the form
'//                               is to bet set, if none applied, ignore
'//             [in] FadeSpeed - the value at which the fade speed should occur,
'//                              the higher the value, the faster the fade
'// =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=[/color]
Public Sub UIProcessFadeIn( _
           UIForm As Form, _
           Optional EndOpacity As Integer = 255, _
           Optional FadeSpeed As Integer = 5)
[color="green"]'// loop counter[/color]
Dim i As Integer
    For i = 1 To EndOpacity Step FadeSpeed
        Call SetTranslucent(UIForm.hWnd, i)
        [color="green"]'// this is required for proper fade effect
        '// otherwise you'll just jump to the transparency immediately
        
        '// you may want to use another method to wait[/color]
        DoEvents
    Next i
End Sub
Go to the top of the page
 
CyberCow
post Jan 18 2007, 04:12 PM
Post#12


UdderAccess Admin + UA Ruler
Posts: 19,555
Joined: 27-April 02
From: Upper MI


Thanks Xy ! ! ! !
imagine I can use a similar mod to control fadeout ? ? ? ?
Go to the top of the page
 
Dom DXecutioner
post Jan 18 2007, 05:17 PM
Post#13



Posts: 1,155
Joined: 18-November 03
From: California


You're welcome,

and yes, the same concept can be applied to the fade out... one thing to point out, the current effect is also based on the DoEvents call.

if you have a relatively slow system and it has lots of other processes, you'll get different fade speed... you could add sort of a timer function to have more control over the fading speed.

maybe another loop withing the loop may be in order,and kill the DoEvents call.
Go to the top of the page
 
khaos
post Jan 19 2007, 10:23 AM
Post#14


Retired Moderator
Posts: 8,589
Joined: 19-December 02
From: Lansing, MI


I have posted code here before for transparent subs. It's ugly and really doesn't work very good. Messes with other controls on the sub and really didn't do what I wanted.
I use transparent forms though as pop-ups and I have no idea if the users use it yet but it was fun to make. 1 control to allow users to fade in and out (on the main form) and have every pop-up change accordingly.
Ken
Go to the top of the page
 
cheekybuddha
post Jan 19 2007, 01:39 PM
Post#15


UtterAccess VIP
Posts: 9,277
Joined: 6-December 03
From: Telegraph Hill


Hmmm...
suppose I wasn't really thinking of transparent/translucent subforms, but using the fade effect to change subforms/SourceObjects.
d
Go to the top of the page
 
perrymans
post Jan 19 2007, 04:13 PM
Post#16



Posts: 256
Joined: 12-November 03
From: Virginia Beach, VA


Xy,
o you have a website that showcases all of your work?
Thanks. Sean.
Go to the top of the page
 
Dom DXecutioner
post Jan 19 2007, 10:55 PM
Post#17



Posts: 1,155
Joined: 18-November 03
From: California


Perrymans,
do not yet have a website but i'm sure within 6 months or so, i should be able to put it back up...
Go to the top of the page
 
r_cubed
post Jan 20 2007, 03:34 AM
Post#18


UtterAccess VIP
Posts: 3,754
Joined: 8-November 02
From: Australia (NSW)


Moo, there is an example in the Arcives forum posted by ChrtisO. I have mod he od hee o alkso allow it to happen with the acual Access window itself (fade in/out).
ound it easier to control user functionality and not have to worry about hiding/creating menus etc .... if they can't see the window, they can't get to those !!!
Pretty happy with it too ....i
Go to the top of the page
 
CyberCow
post Jan 20 2007, 07:39 AM
Post#19


UdderAccess Admin + UA Ruler
Posts: 19,555
Joined: 27-April 02
From: Upper MI


Rob, Thanks! Can you post the link please? (Just to be sure I've found the right one) And would you share your mod . . . that sounds interesting!
Hope all is well down under sad.gif
Go to the top of the page
 
r_cubed
post Jan 20 2007, 03:59 PM
Post#20


UtterAccess VIP
Posts: 3,754
Joined: 8-November 02
From: Australia (NSW)


Moo,
Here is the link to a thread in which I then ALSO 'point' to Chros_O's archived demo.
Inthe thread I have pointed you too above, I also included the code that I am using to 'fade in/out' the application window, PLUS (as Xynox) has stated originally .... all forms have to be Pop-Ups .... I have the code to enable you to BULK update all forms in an existing application to achieve this requirement in about 2 seconds.
All is well down under ..... still travelling for my contract (originally a 4 week/1 application contract which has now become a 9 month/ 4th application contract, and looks like continuing).
Long days (5.30am - 7.30pm) with the travel (train), but GREAT bunch of people to work with (the best I have encountered) and the money is too good.
Hope you get some benefit from the combined links above.
Catch ya in the ether .....
Go to the top of the page
 
2 Pages V  1 2 >


Custom Search
RSSSearch   Top   Lo-Fi    14th December 2017 - 11:23 PM