System.Windows.Forms.Control.SuspendLayout C# (CSharp) Method

SuspendLayout() public method

public SuspendLayout ( ) : void
return void
		public void SuspendLayout() {
			layout_suspended++;
		}

Usage Example

Example #1
0
  //-------------------------------------------------------------------------------------
  /// <summary>
  /// Рекурсивно очищает дочерние контролы с вызовом Parent == null
  /// </summary>
  /// <param name="ctrl"></param>
  public static void ClearChilds(Control ctrl)
  {
   try
   {
    ctrl.SuspendLayout();
    Stack<Control> st = new Stack<Control>();
    foreach(Control c in ctrl.Controls)
     st.Push(c);
    while(st.Count > 0)
    {
     Control c =  st.Pop();
     c.Parent = null;
     if(c.Controls.Count > 0)
     {
      foreach(Control cc in c.Controls)
       st.Push(cc);
     }
     c.Controls.Clear();
    }
   }
   finally
   {
    ctrl.ResumeLayout();
   }

  }
All Usage Examples Of System.Windows.Forms.Control::SuspendLayout
Control