I have an application I have been working on for a while in VS2008 developing in Windows XP and it has some panels placed in specific spots so the borders line up and look nice and pretty. Now that I have switched to developing in 7, as far as I can tell everything else is in the same place but it moves both panels over a little bit and one up and one down and messes up my nice borders. Since it still works correctly in XP I'm assuming this is a 7 problem or a VS problem with 7. Anyone have an idea whats going on or if its fixable?
Windows in Windows 7 have wider borders.
Your form probably has a fixed size that is based on a Windows XP border width.
Therefore, in Windows 7, the form's client area will be narrower.
If this is in fact the problem, you can solve it by setting the form's ClientSize property in the constructor the the value it currently has in XP.
If this is not the problem, please post more details.
Do you need to have your panels pixel-positioned? .NET 2.0 introduced the FlowLayoutPanel and TableLayoutPanel for resizeable positioning of elements.
The TableLayoutPanel is the more useful of the two. You create rows and columns, which can autosize or size proportionally to each other. You dock the TableLayoutPanel in your form or anchor it to all four sides. Then the user can resize your form and everything resizes with it.
Even if your panels are of a specific size, you can anchor them to a side or a corner so that they stick to the side even if the user resizes the form.
So I figured it out. Turns out the client area wasn't narrower, however the titlebar which is part of the dialog box border was two different sizes in XP and 7. Since the panels were in an mdi child, where the border was not shown because it was underneath the parent, the size of the titlebar part of the border was making a difference in the location my panels were shown relative to the parent. To solve this I set FormBorderStyle to none on the child and re-positioned the panels to be in the correct spot without that titlebar. It now looks the same in XP and 7 since that variable bar size is gone.