Hi,
I would like to slide in a child form on to the main form for example from the left. How would I do that.
I suppose I will have to use the annimatewindow api but I do not know how?
Any help.
Marc
How about simply using :
'hForm = handle of child form
nTop = 100
for nLeft = -400 to 250
FF_Control_SetLoc( hForm, nLeft, nTop )
sleep 100
next
Haven't tested this though ...
Kind regards
Thank you Eddy for the suggestion. Unfortunately this gives a lot of flickering.
Regards,
Marc
Maybe you can reduce flicker a little bit by intercepting the WM_PAINT message of the child form.
In WM_PAINT, return 0 and do nothing else there, so no repainting is done.
if you have moved the child form one step (and after SLEEP), let WM_PAINT not return 0 anymore so Windows does the repainting for you. Then call UpdateWindow function.
Otherwise, you might have to do some double buffering. Do the sliding in in a hidden window and BitBlit to the front window...
Thanks again Eddy. But that is really way out of my league.
So much info. ??? ::) :-[
Marc
I don't have much time now but if you could zip up a 'minimal code' example using the FF_Control_SetLoc method, maybe I can try out a few things.
Ok, thanks for your help.
Marc
Hi Marc
I added about 8 buttons to your child form, to better notice flicker.
I didn't think it was that bad really. On my box the button texts are just a bit blurry while moving, no real flicker.
I could not achieve a significant improvement playing with WM_PAINT.
For a real improvement you would need to use double buffering. But I have never used that myself. Sorry ...
Kind regards
Thanks anyway Eddy.
It keeps supprising me that graphic things are so difficult to do and achieve under windows.
Best regards,
Marc
I don't know if this is any better or not.
I move the form in its own thread.
Also turned on WS_CLIPCHILDREN on the child form.
Any of these stutter if you move the mouse while the form is moving.
Hi Robert,
that looks better on my machine. Thank you.
I attached a variation on the project with Slide In en Slide Out.
Now look what happens when you Slide In - Slide out - Slide in.
I do not know anything about threads so this must be related to that I think.
Best regards,
Marc
The code in the thread is running all of the time as a separate process until you either exit the program or add code to stop the thread. So in your version the form was trying to slide in and out at the same time.
So here is a quick modification to the previous program. I just added a global variable to indicate the direction the form is moving.
Thank you Robert and Eddy.
Very logical if you look at it. I learned something today. Thank you again.
Have a very nice weekend!
Marc