Set Form Location Causes Resize

G

Guest

Ok, I have kind of a weird issue I haven't seen before.
I am attempting to set the location of a new form to pop up in the same location as another.
I have code similar to the following:

Dim nextForm as New frmWizard2
nextForm.Location = lastFormLocation '<- Problem line
nextForm.ShowDialog()

Ok, everything seems hooked up properly, and this is not the first time i have done this, just the first time it hasn't worked.
When I set the location of the new form, it appears in the correct location, but it's size has changed (gotten smaller).
If I remove that line, the size is correct, but of course the form pops up wherever it wants.
I've tried SetDesktopLocation, and other various methods. Whatever I do, if I change the location of the form it changes size (clips bottom).

Anyone else ever seen anything like this?
General stuff:
VS.Net 2003
Form.FormBorderStyle=FixedSingle
Form.StartPosition = Manual
I have no code in the form that could change it's size.
I have no auto-sizers or anything else that could explain this.

Thanks.
 
G

Guest

I guess lastFormLocation is used by other object.
try this:
nextForm.Location = New Point(lastFormLocation.x, lastFormLocation.y)
 
G

Guest

Thanks for the response.
But sadly, it is not anything like this.
The lastFormLocation is created and retrieved just prior to use.
Besides...
1. it is a Value type and wouldn't be changable outside my function anyway.
2. even if it could, that might only change the Location of the form (which is correct), but NOT the size.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top