Link to home
Start Free TrialLog in
Avatar of jackjohnson44
jackjohnson44

asked on

vb.net form position

I am trying to set the position of a form, but it seems to pop up at a random place every time.

            SetParent(testProgram.Handle.ToInt32, Me.Handle.ToInt32)
            testProgram.Show()
            testProgram.Top = 100
            testProgram.Left = 100

or
            SetParent(testProgram.Handle.ToInt32, Me.Handle.ToInt32)
            testProgram.Show()
            testProgram.Top = me.top
            testProgram.Left = me.left +100

I also tried
           testProgram.Location = New Point(10,10)
Avatar of Ravi Singh
Ravi Singh
Flag of United Kingdom of Great Britain and Northern Ireland image

Have you tried setting the forms StartPosition property to manual?

SetParent(testProgram.Handle.ToInt32, Me.Handle.ToInt32)
testProgram.StartPosition = FormStartPosition.Manual;
testProgram.Location = New Point(10,10)
testProgram.Show()
sorry remove the semi colon after the second line
ASKER CERTIFIED SOLUTION
Avatar of YZlat
YZlat
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial