Solved

How to set Form position when using AnimateWindow API?

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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

828 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