Solved

How to set Form position when using AnimateWindow API?

Posted on 2004-08-31
1
357 Views
Last Modified: 2012-05-05
Using the AnimateWindow API to display a Form.  This works, but the Form position is random.

I have tried this, but the position still seems to be random:

Dim f2 As New Form2
        f2.Left = 600
        f2.Top = 600
        AnimateWindow(f2.Handle, 300, AnimateWindowFlags.AW_VER_NEGATIVE Or AnimateWindowFlags.AW_CENTER)
        f2.Show()

Thanks for any ideas.
0
Comment
Question by:mistert006
1 Comment
 
LVL 25

Accepted Solution

by:
RonaldBiemans earned 500 total points
ID: 11942896
have you tried


Dim f2 As New Form2
f2.StartPosition =FormStartPosition.Manual
        f2.Left = 600
        f2.Top = 600
        AnimateWindow(f2.Handle, 300, AnimateWindowFlags.AW_VER_NEGATIVE Or AnimateWindowFlags.AW_CENTER)
        f2.Show()
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

759 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now