Growing user control not updating

Posted by user328259 on Stack Overflow See other posts from Stack Overflow or by user328259
Published on 2010-04-28T20:47:24Z Indexed on 2010/04/28 21:07 UTC
Read the original article Hit count: 254

Filed under:
|
|
|
|

I am developing in C# and .Net 2.0. I have a user control that draws cells (columnar) depending upon the maximum number of cells. There are some drawing routines that generate the necessary cells. There is a property NumberOfCells that adjust the height of this control; CELLHEIGHT_CONSTANT * NumberOfCells. The OnPaint() method is overridden (code that draws the Number of cells).

There is another user control that contains a panel which contains the userControl1 from above. There is a property NumberCells that changes userControl1's NumberOfCells.

UserControl2 is then placed on a windows form. On that form there is a NumericUpDown control (only increments from 1). When the user increments by 1, I adjust the VerticalScroll.Maximum by 1 as well.

Everything works well and good BUT when I increment once, the panel updates fine (inserts a vertical scrolll when necessary) but cells are not being added! I've tried Invalidating on userControl2 AND on the form but nothing seems to draw the newly added cells.

Any assistance is appreciated. Thank you in advance.

  • Lawrence

© Stack Overflow or respective owner

Related posts about c#

Related posts about user