C#中,用System.ComponentModel.ISupportInitialize怎么用阿,急啊

解决方案 »

  1.   

    指定该对象支持对批初始化的简单的事务处理通知。
    ((System.ComponentModel.ISupportInitialize)(this.trackBar1)).BeginInit();
    this.SuspendLayout();
    // 
    // trackBar1
    // 
    this.trackBar1.Location = new System.Drawing.Point(160, 400);
    this.trackBar1.Name = "trackBar1";
    this.trackBar1.TabIndex = 1;
    this.trackBar1.Scroll += new System.EventHandler(this.trackBar_Scroll);
    ((System.ComponentModel.ISupportInitialize)(this.trackBar1)).EndInit();
      

  2.   

    补充下
    ISupportInitialize 允许控件优化多种属性分配。因此,可以在设计时初始化相互依赖的属性或批设置多个属性。调用 BeginInit 方法用信号通知对象初始化即将开始。调用 EndInit 方法用信号通知初始化已完成。