ListView.OnAfterLabelEdit Method (LabelEditEventArgs)

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Raises the AfterLabelEdit event.

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

abstract OnAfterLabelEdit : 
        e:LabelEditEventArgs -> unit
override OnAfterLabelEdit : 
        e:LabelEditEventArgs -> unit

Parameters

e
Type: System.Windows.Forms.LabelEditEventArgs

A LabelEditEventArgs that contains the event data.

Raising an event invokes the event handler through a delegate. For more information, see Handling and Raising Events.

The OnAfterLabelEdit method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.

Notes to Inheritors:

When overriding OnAfterLabelEdit in a derived class, be sure to call the base class's OnAfterLabelEdit method so that registered delegates receive the event.

The following code example demonstrates how to use the AfterLabelEdit event to restrict a newly edited label to characters in the alphabet. The example uses the ASCIIEncoding class to obtain the ASCII character code of each character of the new label. If the character falls between the ASCII codes that represent numbers, the new label cannot be applied to the item. This example requires that you have created a ListView control on a form and added items to it. The example also requires that you have connected the AfterLabelEdit event to the event handler defined in the example code. In order to use the ASCIIEncoding class, your file must include the System.Text namespace.

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

.NET Framework
Available since 1.1
Return to top
Show: