|
-
Sep 14th, 2001, 07:53 AM
#1
Thread Starter
Frenzied Member
Need code for fading in popup boxes ..
Does anyone have access to code or know of an API I can use to make my popup boxes 'fade-in', or basically do anything apart from just suddenly appear when a button is clicked ?
Just trying to jazz things up a bit !
Cheers.
-
Sep 14th, 2001, 08:33 AM
#2
-
Sep 14th, 2001, 08:53 AM
#3
Thread Starter
Frenzied Member
Nice effect ...
Thats just the sort of thing I was looking for !!
Unfortunately, when I click the button that opens my form (yes, sorry it was forms I was referring to !), it 'explodes' a white box almost the size of my screen !!
I looked at the code in the module that does the 'exploding', but don't have enough experience to know what, if anything, I need to change.
Any ideas ?
-
Sep 14th, 2001, 09:09 AM
#4
BionicOrange:
I tried InvisibleDuncans form (very cool!), and it worked just dandy on my machine.
I added a second form to the project, and loaded his form from it, and it still worked fine.
I'm thinking that perhaps there might be a monitor, or screen resolution difference going on here.
-
Sep 14th, 2001, 09:33 AM
#5
Thread Starter
Frenzied Member
Hmmmm .........
Maybe you're right.
I'm using 1024 x 768 resolution.
also, the form that contains the button (which opens the exploding form) is an MDI child. Don't know if this has an impact !
-
Sep 14th, 2001, 09:39 AM
#6
I don't know about the MDI thing. Could be. It would be interesting if you could run his forms on another machine with a different resolution to see what would happen.
-
Sep 14th, 2001, 09:43 AM
#7
Thread Starter
Frenzied Member
Doh !
When I first ran the sample code, it worked fine.
When I ran it in my app., it didn't.
Both times I was in the same resolution !!!!! (1024 x 768)
I tried the sample code in 800 x 600 and it worked fine in that too.
Fuess that rules out resolution problems.
-
Sep 14th, 2001, 10:21 AM
#8
Fanatic Member
The code uses the GetWindowRect API to find out the size of the form you're building. It then creates a brush, and uses that to build a series of rectangles based on the number you specified when you called the procedure (in my example I've used 2,500 - so it draws 2,500 rectangles, starting at 1/2,500 the size of your form up to the size of your form).
As far as I can see, having it as an MDI child shouldn't make a difference. I've tested it on an MDI child, and it still seems to work the same.
Sorry...
-
Sep 17th, 2001, 03:04 AM
#9
Thread Starter
Frenzied Member
.
Due to teh nature of my program, I can't put the 'SubExplodeForm Me, 2500' line in the form load, but need to put it in the form refresh.
This seems to cause a problem as the form is drawn, then the 'explode' effect happens, then I lose my form title bar (it stays white) and teh edge of my listview box on the form !
I presume this is a timing issue because the form has already been drawn by the time the 'Form Activate' routine is called ? (This is a guess !)
Don't want to make a mountain out of a molehill, just would be nice to use as its a nice effect.
Thanks regardless.
-
Sep 17th, 2001, 03:28 AM
#10
Fanatic Member
I think, then, that you might be stuck. The exploding effect isn't actually connected to the form; all it uses is the form's size and it then paints a series of rectangle up to that size. I guess if it does that over the top of an existing form, it might cause problems.
I'm not too sure why you wouldn't be able to put it in the Form_Load, because this relates purely to display. You're the boss, though.
One final possibility: You could put the procedure between the load and the show on the form that calls it. For example:
VB Code:
Private Sub Command1_Click()
'# Load the form
Load FrmImplodeExplode
'# Explode the form as it opens
SubExplodeForm FrmImplodeExplode, 2500
'# Show the form itself
FrmImplodeExplode.Show
End Sub
That any good to you?
-
Sep 17th, 2001, 04:07 AM
#11
Thread Starter
Frenzied Member
.
Ha Ha ! 10 out of 10 for perseverence !
The reason it can't go in the form load event is because the form contains a listview box, which has items added to it whilst my main form is built. Its purely up to the user if they want to eventually click the button that loads this form when all prcessing is complete.
I've noticed that when you address a control on a form it runs through the form load event, therefore the form concerned runs the 'explode' routine as my processing is half way through.
Also I don't unload the form I just hide it, because otherwise my listview wil lose all of its data.
If you know of a better way then please tell. I'm pretty new at all this so I'm sure I'm not doing a lot of things the best way possible.
My program does a lot of processing before the user can intervene, so that when it gets that far they have no more waiting.
Thanks for the input so far by the way.
Steve.
-
Sep 17th, 2001, 07:42 AM
#12
Fanatic Member
So, is the code on my previous post no good to you? If you put that on the button that loads the exploding form it should work. You then won't need to put it in the form itself at all. As long as you call SubExplodeForm immediately prior to showing the form, you should be alright. Just make sure you pass the form's name in as a parameter instead of using Me.
-
Sep 17th, 2001, 09:12 AM
#13
Thread Starter
Frenzied Member
.
Sorry about that, i didn't read it properly (one of those days .... I HATE Mondays !).
That now actually works perfectly , so thanks very much for all your help (and the code in the first place !)
-
Sep 17th, 2001, 09:32 AM
#14
Fanatic Member
My pleasure. I'm glad you got it working - I'd hate to think that I was posting crappy code...
-
Oct 16th, 2001, 01:29 AM
#15
Fanatic Member
THE ESAYEST WAY!!!
Hey.
I find a easy way to do this.You will find it is very simple to make a popup boxes 'fade-in'.
Here is the exe.
-
Oct 16th, 2001, 02:42 AM
#16
Thread Starter
Frenzied Member
Very nice effect.
Any chance of the source code to see how 'simple' they are to do ??
-
Oct 16th, 2001, 02:48 AM
#17
Fanatic Member
-
Oct 16th, 2001, 03:17 AM
#18
Thread Starter
Frenzied Member
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
|