public void updateWallArea() { this.wallScrollArea.clearControls(); int y = 0; this.lineList.Clear(); int lineID = 0; foreach (WallInfo info in this.wallList) { CustomSelfDrawPanel.ParishWallEntry control = new CustomSelfDrawPanel.ParishWallEntry(); if (y != 0) { y += 5; } control.Position = new Point(0, y); control.init(info, lineID, this.m_currentVillage, this); this.wallScrollArea.addControl(control); y += control.Height; this.lineList.Add(control); lineID++; } this.wallScrollArea.Size = new Size(this.wallScrollArea.Width, y); if (y < this.wallScrollBar.Height) { this.wallScrollBar.Visible = false; } else { this.wallScrollBar.Visible = true; this.wallScrollBar.NumVisibleLines = this.wallScrollBar.Height; this.wallScrollBar.Max = y - this.wallScrollBar.Height; } this.wallScrollArea.invalidate(); this.wallScrollBar.invalidate(); }