Before showing a form my code adjusts its size, but after calling its Show() method it has a size that is neither the one it's initialized to in ...Designer.vb nor the one I just set it to.
I set a breakpoint in its Resize() handler, and the chain of calls from Show() to Resize() looks like this:
MyApp.exe!MyApp.SearchListForm.frmSearchList_Resize(Object eventSender, System.EventArgs eventArgs) Line 2256 Basic
System.Windows.Forms.dll!System.Windows.Forms.Control.OnResize(System.EventArgs e) + 0xbb bytes
System.Windows.Forms.dll!System.Windows.Forms.Form.OnResize(System.EventArgs e) + 0xd bytes
System.Windows.Forms.dll!System.Windows.Forms.Control.OnSizeChanged(System.EventArgs e) + 0x29 bytes
System.Windows.Forms.dll!System.Windows.Forms.Control.UpdateBounds(int x, int y, int width, int height, int clientWidth, int clientHeight) + 0x9c bytes
System.Windows.Forms.dll!System.Windows.Forms.Control.UpdateBounds() + 0xd1 bytes
System.Windows.Forms.dll!System.Windows.Forms.Control.WmCreate(ref System.Windows.Forms.Message m) + 0x29 bytes
System.Windows.Forms.dll!System.Windows.Forms.Control.WndProc(ref System.Windows.Forms.Message m) + 0x2e7 bytes
System.Windows.Forms.dll!System.Windows.Forms.ScrollableControl.WndProc(ref System.Windows.Forms.Message m) + 0x2a bytes
System.Windows.Forms.dll!System.Windows.Forms.ContainerControl.WndProc(ref System.Windows.Forms.Message m) + 0x10 bytes
System.Windows.Forms.dll!System.Windows.Forms.Form.WmCreate(ref System.Windows.Forms.Message m) + 0xe bytes
System.Windows.Forms.dll!System.Windows.Forms.Form.WndProc(ref System.Windows.Forms.Message m) + 0x193 bytes
System.Windows.Forms.dll!System.Windows.Forms.Control.ControlNativeWindow.OnMessage(ref System.Windows.Forms.Message m) + 0x10 bytes
System.Windows.Forms.dll!System.Windows.Forms.Control.ControlNativeWindow.WndProc(ref System.Windows.Forms.Message m) + 0x31 bytes
System.Windows.Forms.dll!System.Windows.Forms.NativeWindow.DebuggableCallback(System.IntPtr hWnd, int msg, System.IntPtr wparam, System.IntPtr lparam) + 0x57 bytes
[Native to Managed Transition]
[Managed to Native Transition]
System.Windows.Forms.dll!System.Windows.Forms.UnsafeNativeMethods.CreateWindowEx(int dwExStyle, string lpszClassName, string lpszWindowName, int style, int x, int y, int width, int height, System.Runtime.InteropServices.HandleRef hWndParent, System.Runtime.InteropServices.HandleRef hMenu, System.Runtime.InteropServices.HandleRef hInst, object pvParam) + 0x3c bytes
System.Windows.Forms.dll!System.Windows.Forms.NativeWindow.CreateHandle(System.Windows.Forms.CreateParams cp) + 0x225 bytes
System.Windows.Forms.dll!System.Windows.Forms.Control.CreateHandle() + 0x125 bytes
System.Windows.Forms.dll!System.Windows.Forms.Form.CreateHandle() + 0x9f bytes
System.Windows.Forms.dll!System.Windows.Forms.Control.Handle.get() + 0x45 bytes
System.Windows.Forms.dll!System.Windows.Forms.Form.SetVisibleCore(bool value) + 0x160 bytes
System.Windows.Forms.dll!System.Windows.Forms.Control.Show() + 0x10 bytes
I'm assuming there's some component with a Location and Size that force the Form to shape itself to their needs, but I can't really tell from the stack trace and I don't know how to find out what the cause is.
Any suggestions?
TIA