Why do winform controls move on their own when I save the form

后端 未结 1 1030
忘掉有多难
忘掉有多难 2020-12-21 17:23

I am having an issue with button controls moving when I close my form in the editor in VS 2012. I am working in C# exclusively. This is diving me nuts as I have to repositio

相关标签:
1条回答
  • 2020-12-21 18:04

    This happens often if you have a base form (or user control) where you set some anchors for the controls and in derived designer your form has a different size.

    A possible solution is to forget anchoring and to use docking instead. You can achieve everything by using the Dock, Margin and Padding properties; however, it can be strange for the first time that you might need to use many invisible panels (for example when you want to use two lines of controls below each other). This is a similar approach as using Stack/Dock panels in WPF.

    Additionally, you can play with the TableLayoutPanel as well.

    0 讨论(0)
提交回复
热议问题