By IAmFrenk


2019-06-05 08:43:02 8 Comments

I have a Windows Form where I can dynamically add/remove Controls (in rows).

Everything works as intended, until the Windows Form's max size has been reached.

After that happens the Control's locations won't update correctly anymore.

Here's an example: https://i.imgur.com/xADXb4L.png

It might be useful to know that the Windows Form has AutoSize = true and AutoSizeMode = GorwAndShrink.

Thanks in advance.

1 comments

@IAmFrenk 2019-06-12 07:43:44

If anyone is interested, found the answer on a 9 year old discussion: https://www.daniweb.com/programming/software-development/threads/270543/control-added-on-the-fly-is-added-to-the-wrong-location-of-an-auto-scroll-panel

TL;DR Setting a Control's location when the Control is invisible doesn't work correctly. Making the Controls visible before I set their locations fixed all my problems.

Related Questions

Sponsored Content

4 Answered Questions

[SOLVED] How do I get a control's location relative to its Form's location?

  • 2012-04-19 20:38:58
  • ispiro
  • 15717 View
  • 7 Score
  • 4 Answer
  • Tags:   c# winforms

0 Answered Questions

Form autosize to datagridview content

0 Answered Questions

WinForms TableLayout won't Downsize

0 Answered Questions

Control's size does not update with autosize set to true

0 Answered Questions

Check if the next row to be added will be larger than a TablePanelLayout control's height

  • 2016-08-15 16:30:00
  • blearyeye
  • 36 View
  • 0 Score
  • 0 Answer
  • Tags:   c# winforms

2 Answered Questions

[SOLVED] FlowLayoutPanel Height bug when using AutoSize

2 Answered Questions

1 Answered Questions

2 Answered Questions

[SOLVED] Winforms autoresizing a form with a status bar

  • 2012-08-29 19:23:37
  • user981225
  • 1953 View
  • 2 Score
  • 2 Answer
  • Tags:   c# winforms c#-4.0

1 Answered Questions

How to automatically resize controls based on the language associated .resx info?

  • 2011-09-09 13:37:08
  • Markoff Chaney
  • 220 View
  • 0 Score
  • 1 Answer
  • Tags:   c# .net winforms

Sponsored Content