Upraviť

Zdieľať cez


ToolStripDropDownClosedEventArgs Class

Definition

Provides data for the Closed event.

public ref class ToolStripDropDownClosedEventArgs : EventArgs
public class ToolStripDropDownClosedEventArgs : EventArgs
type ToolStripDropDownClosedEventArgs = class
    inherit EventArgs
Public Class ToolStripDropDownClosedEventArgs
Inherits EventArgs
Inheritance
ToolStripDropDownClosedEventArgs

Examples

The following code example demonstrates the use of this type. In the example, an event handler reports on the occurrence of the Closed event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing Show with Console.WriteLine or appending the message to a multiline TextBox.

To run the example code, paste it into a project that contains an instance of type ToolStripDropDown named ToolStripDropDown1. Then ensure that the event handler is associated with the Closed event.

private void ToolStripDropDown1_Closed(Object sender, ToolStripDropDownClosedEventArgs e) {

System.Text.StringBuilder messageBoxCS = new System.Text.StringBuilder();
messageBoxCS.AppendFormat("{0} = {1}", "CloseReason", e.CloseReason );
messageBoxCS.AppendLine();
MessageBox.Show(messageBoxCS.ToString(), "Closed Event" );
}
Private Sub ToolStripDropDown1_Closed(sender as Object, e as ToolStripDropDownClosedEventArgs) _ 
     Handles ToolStripDropDown1.Closed

    Dim messageBoxVB as New System.Text.StringBuilder()
    messageBoxVB.AppendFormat("{0} = {1}", "CloseReason", e.CloseReason)
    messageBoxVB.AppendLine()
    MessageBox.Show(messageBoxVB.ToString(),"Closed Event")

End Sub

Remarks

Use data from the ToolStripDropDownClosedEventArgs method to make decisions about actions to take when a drop-down control closes.

Constructors

ToolStripDropDownClosedEventArgs(ToolStripDropDownCloseReason)

Initializes a new instance of the ToolStripDropDownClosedEventArgs class.

Properties

CloseReason

Gets the reason that the ToolStripDropDown closed.

Methods

Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetType()

Gets the Type of the current instance.

(Inherited from Object)
MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
ToString()

Returns a string that represents the current object.

(Inherited from Object)

Applies to

See also