Solved

How to set Form position when using AnimateWindow API?

Posted on 2004-08-31
1
367 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

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 …
Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
A company’s greatest vulnerability is their email. CEO fraud, ransomware and spear phishing attacks are the no1 threat to a company’s security. Cybercrime is responsible for the largest loss of money to companies today with losses projected to r…

932 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

14 Experts available now in Live!

Get 1:1 Help Now