TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Damien O Neill
NA
7
2.8k
(Solved/Void) Form Start location will not update/renew after changing form size
Jan 22 2012 10:03 AM
Hi All, never thought I would be the one posting a question but this one is baffling me.
I set the form startup location to centre on my 2nd monitor (dual) last week.
This week I increased the form height to add more function but the form insists on its starting location being that of the old form.
Both Monitors are 1280 x 1024
The code for setting the location is as follows:
Dim screen As Screen
screen = screen.AllScreens(1)
Me.StartPosition = FormStartPosition.Manual
Me.Location = New System.Drawing.Point((((1280 / 2) - (Me.Width / 2)) + 1280), ((1280 / 2) - (Me.Height / 2)))
This worked just fine before I changed the form height. However, once the form size changed, the location did not update as it should have with the x,y co-ordinates still acting as if the form was the old size.
I also tried to change the location manually by entering in the exact x,y values but the form starts in the correct location and then a split second later moves back to the old incorrect location.
Is there something I am not doing to flush the old values?
Reply
Answers (
4
)
Extension Metod
Drill down combo boxes