DekGenius.com
[ Team LiB ] Previous Section Next Section

LayoutEventArgs

System.Windows.Forms (system.windows.forms.dll)sealed class

This encapsulates the data for the Control.Layout event.

In Win32 applications, you would tend to hook the WM_SIZE event if you were developing a layout manager. However, handling the Control.Resize event is no longer the preferred way of doing this.

The Layout event is raised not just when the window is resized, but also when controls are added, removed, and modified, giving you a single point to hook all the activities that might cause you to reformat the layout of a form. You can also raise a Layout event with the Control.PerformLayout() method, which allows you to specify the control that caused the event, and a string indicating the property that changed. These event arguments encapsulate those two pieces of information, although more often than not you will find that they are null when you are dealing with events raised by the framework. The layout event will not be raised if Control.SuspendLayout() is called, until the corresponding Control.ResumeLayout().

public sealed class LayoutEventArgs : EventArgs {
// Public Constructors
   public LayoutEventArgs(Control affectedControl, string affectedProperty);
// Public Instance Properties
   public Control AffectedControl{get; }
   public string AffectedProperty{get; }
}

Hierarchy

System.Object System.EventArgs LayoutEventArgs

Passed To

System.Windows.Forms.Design.ComponentTray.OnLayout(), LayoutEventHandler.{BeginInvoke(), Invoke()}

    [ Team LiB ] Previous Section Next Section