Solved

vb.net form position

Posted on 2006-07-17
3
2,109 Views
Last Modified: 2008-01-09
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)
0
Comment
Question by:jackjohnson44
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 18

Expert Comment

by:Ravi Singh
ID: 17126333
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()
0
 
LVL 18

Expert Comment

by:Ravi Singh
ID: 17126338
sorry remove the semi colon after the second line
0
 
LVL 35

Accepted Solution

by:
YZlat earned 500 total points
ID: 17126411
did you try setting location before showing the form?


 testProgram.Top = 100
            testProgram.Left = 100

 testProgram.Show()
           
0

Featured Post

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

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…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

739 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