打开窗体设计视图出现如下错误:
查看后台代码:
ColumnHeader colHead; colHead = new ColumnHeader(); colHead.Text = "Ch"; colHead.Width = 30; this.ChList.Columns.Add(colHead); colHead = new ColumnHeader(); colHead.Text = "ChType"; colHead.Width = 99; this.ChList.Columns.Add(colHead); colHead = new ColumnHeader(); colHead.Text = "Status"; colHead.Width = 78; this.ChList.Columns.Add(colHead); colHead = new ColumnHeader(); colHead.Text = "CallerId"; colHead.Width = 80; this.ChList.Columns.Add(colHead); colHead = new ColumnHeader(); colHead.Text = "CalleeId"; colHead.Width = 80; this.ChList.Columns.Add(colHead); // colHead = new ColumnHeader(); colHead.Text = "DTMFBuffer"; colHead.Width = 80; this.ChList.Columns.Add(colHead);
发现设计器不能识别相同变量的声明不同的实例。
将每个ColumnHeader 都声明一次 解决问题