Solved

vb.net form position

Posted on 2006-07-17
3
2,102 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
  • 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

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

If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
Both in life and business – not all partnerships are created equal. As the demand for cloud services increases, so do the number of self-proclaimed cloud partners. Asking the right questions up front in the partnership, will enable both parties …

920 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

16 Experts available now in Live!

Get 1:1 Help Now