5

When removing an anchoring, a control can automatically resize itself to some other size.

Steps to reproduce

  1. Drop a control on a form

    enter image description here

  2. Set an anchor

    enter image description here

  3. Resize the form; watch the control resize with it:

    enter image description here

  4. Remove the anchor:

    enter image description here

  5. Watch the control resize itself without permission:

    enter image description here

Ian Boyd
  • 246,734
  • 253
  • 869
  • 1,219
  • 8
    Blame `ExplicitWidth` for that. You can [`disable storing them`](http://stackoverflow.com/a/2477072/960757). – TLama Jan 22 '15 at 16:46
  • 1
    A hard-to-remember workaround is to change the width of the memo (in your case) either manually editing in OI or by mouse, in between steps 3 and 4. – Tom Brunberg Jan 22 '15 at 21:56
  • 1
    @TLama shouldn't you add your comment as an answer? Or it doesn't stop the auto resizing? – EMBarbosa Jan 27 '15 at 15:03

1 Answers1

1

When you create control, It gets initial parameters. Among them there are height and width. When you enable anchoring and resize form, the control also resizes, but initial parameters don't change. Thats why, when you remove anchoring, it gets its initial size.

Ulphat
  • 734
  • 1
  • 7
  • 26