public BeedColumns() { BeedColumn column; int col_width = this.Width / cols; int col_height = this.Height; beedColumnArray = new BeedColumn[cols]; for (int i = 0; i < cols; i++) { column = new BeedColumn(); column.Width = col_width; column.Height = col_height; column.Margin = new Padding(0); column.Padding = new Padding(0); column.Location = new Point(i * col_width, 0); Console.WriteLine(column.Location.ToString() + "," + i); beedColumnArray[i] = column; column.ColValueChanged += new EventHandler(ColValueChanged); column.DecimalPlaceRequest += new EventHandler(DecimalPlaceChanged); this.Controls.Add(column); } putWhiteDots(wdotPos, wdotInt); InitializeComponent(); }
private void resizeColumn() { BeedColumn[] col_old, col_new; BeedColumn column; int col_width = this.Width / cols; int col_height = this.Height; int i; col_new = new BeedColumn[cols]; col_old = beedColumnArray; this.Controls.Clear(); for (i = 0; i < col_new.Length && i < col_old.Length; i++) { col_new[i] = col_old[i]; this.Controls.Add(col_new[i]); } for (int j = i; j < col_new.Length; j++) { if (col_new[j] != null) { continue; } column = new BeedColumn(); column.Width = col_width; column.Height = col_height; column.Margin = new Padding(0); column.Padding = new Padding(0); column.Location = new Point(i * col_width, 0); column.ColValueChanged += new EventHandler(ColValueChanged); column.DecimalPlaceRequest += new EventHandler(DecimalPlaceChanged); col_new[j] = column; this.Controls.Add(column); } beedColumnArray = col_new; putWhiteDots(wdotPos, wdotInt); }