Export (0) Print
Expand All

LayoutEventArgs Class

Provides data for the Layout event. This class cannot be inherited.

System.Object
  System.EventArgs
    System.Windows.Forms.LayoutEventArgs

Namespace:  System.Windows.Forms
Assembly:  System.Windows.Forms (in System.Windows.Forms.dll)

[<Sealed>]
type LayoutEventArgs =  
    class
        inherit EventArgs
    end

The LayoutEventArgs type exposes the following members.

  NameDescription
Public methodLayoutEventArgs(Control, String)Initializes a new instance of the LayoutEventArgs class with the specified control and property affected.
Public methodLayoutEventArgs(IComponent, String)Initializes a new instance of the LayoutEventArgs class with the specified component and property affected.
Top

  NameDescription
Public propertyAffectedComponentGets the Component affected by the layout change.
Public propertyAffectedControlGets the child control affected by the change.
Public propertyAffectedPropertyGets the property affected by the change.
Top

  NameDescription
Public methodEquals(Object)Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public methodGetHashCodeServes as a hash function for a particular type. (Inherited from Object.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)
Top

Changes to a control such as resizing, showing or hiding child controls, and adding or removing child controls make it necessary for a control to layout its child controls. A LayoutEventArgs specifies the child control that has been changed and its affected property. For example, if a control has been made visible since the last layout operation, the Visible property is affected.

The AffectedControl and AffectedProperty properties are set to a null reference (Nothing in Visual Basic) if no values were provided when the PerformLayout method was called.

For more information about handling events, see Consuming Events.

The following code example uses the AffectedProperty and AffectedControl properties as LayoutEventHandler arguments to coordinate the size of a Windows form and its controls with various property changes to both the Windows form and the controls.

No code example is currently available or this language may not be supported.

.NET Framework

Supported in: 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Community Additions

ADD
Show:
© 2014 Microsoft