0

I have a base form in my application, that I use the derive other forms from. This all works well, except that whenever I use the visual editor to change a derived form, the locations and sizes of widgets are b0rked.

Buttons move outside of the form, widgets become larger than the form, etc.

It only happens to widgets that are anchored right and bottom.

How can I prevent this?

Bart Friederichs
  • 33,050
  • 15
  • 95
  • 195
  • Easiest solution: Don't use WinForms. But I got a question to maybe be able to help, did you edit the Form.g.cs (where InitializeComponents is defined)? – MindSwipe May 28 '19 at 12:53
  • @MindSwipe that is certainly not the easiest solution, as this is part of an exsiting application with many forms. I didn't edit the `Form.g.cs` (I do not even have that file ... ) – Bart Friederichs May 28 '19 at 13:03
  • That has always been a problem, not specific to 2019. At issue is that you'll change the size of the inherited form but the anchored location was based on the original size. Only workaround I know is to not anchor to bottom/right in the base form but to change it in the inherited form. – Hans Passant May 28 '19 at 13:11
  • @HansPassant that workaround works for me. Am testing it now. – Bart Friederichs May 28 '19 at 13:55
  • Related: [How to get the size of an inherited form in the base form?](https://stackoverflow.com/q/55758166/7444103). – Jimi May 28 '19 at 14:35

0 Answers0