แก้ไข

แชร์ผ่าน


DataGridViewColumnDividerDoubleClickEventArgs Class

Definition

Provides data for the ColumnDividerDoubleClick event of a DataGridView.

public ref class DataGridViewColumnDividerDoubleClickEventArgs : System::Windows::Forms::HandledMouseEventArgs
public class DataGridViewColumnDividerDoubleClickEventArgs : System.Windows.Forms.HandledMouseEventArgs
type DataGridViewColumnDividerDoubleClickEventArgs = class
    inherit HandledMouseEventArgs
Public Class DataGridViewColumnDividerDoubleClickEventArgs
Inherits HandledMouseEventArgs
Inheritance
DataGridViewColumnDividerDoubleClickEventArgs

Examples

The following code example demonstrates the use of this type. In the example, an event handler reports on the occurrence of the ColumnDividerDoubleClick 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 DataGridView named DataGridView1. Then ensure that the event handler is associated with the ColumnDividerDoubleClick event.

private void DataGridView1_ColumnDividerDoubleClick(Object sender, DataGridViewColumnDividerDoubleClickEventArgs e) {

System.Text.StringBuilder messageBoxCS = new System.Text.StringBuilder();
messageBoxCS.AppendFormat("{0} = {1}", "ColumnIndex", e.ColumnIndex );
messageBoxCS.AppendLine();
messageBoxCS.AppendFormat("{0} = {1}", "Handled", e.Handled );
messageBoxCS.AppendLine();
messageBoxCS.AppendFormat("{0} = {1}", "Button", e.Button );
messageBoxCS.AppendLine();
messageBoxCS.AppendFormat("{0} = {1}", "Clicks", e.Clicks );
messageBoxCS.AppendLine();
messageBoxCS.AppendFormat("{0} = {1}", "X", e.X );
messageBoxCS.AppendLine();
messageBoxCS.AppendFormat("{0} = {1}", "Y", e.Y );
messageBoxCS.AppendLine();
messageBoxCS.AppendFormat("{0} = {1}", "Delta", e.Delta );
messageBoxCS.AppendLine();
messageBoxCS.AppendFormat("{0} = {1}", "Location", e.Location );
messageBoxCS.AppendLine();
MessageBox.Show(messageBoxCS.ToString(), "ColumnDividerDoubleClick Event" );
}
Private Sub DataGridView1_ColumnDividerDoubleClick(sender as Object, e as DataGridViewColumnDividerDoubleClickEventArgs) _ 
     Handles DataGridView1.ColumnDividerDoubleClick

    Dim messageBoxVB as New System.Text.StringBuilder()
    messageBoxVB.AppendFormat("{0} = {1}", "ColumnIndex", e.ColumnIndex)
    messageBoxVB.AppendLine()
    messageBoxVB.AppendFormat("{0} = {1}", "Handled", e.Handled)
    messageBoxVB.AppendLine()
    messageBoxVB.AppendFormat("{0} = {1}", "Button", e.Button)
    messageBoxVB.AppendLine()
    messageBoxVB.AppendFormat("{0} = {1}", "Clicks", e.Clicks)
    messageBoxVB.AppendLine()
    messageBoxVB.AppendFormat("{0} = {1}", "X", e.X)
    messageBoxVB.AppendLine()
    messageBoxVB.AppendFormat("{0} = {1}", "Y", e.Y)
    messageBoxVB.AppendLine()
    messageBoxVB.AppendFormat("{0} = {1}", "Delta", e.Delta)
    messageBoxVB.AppendLine()
    messageBoxVB.AppendFormat("{0} = {1}", "Location", e.Location)
    messageBoxVB.AppendLine()
    MessageBox.Show(messageBoxVB.ToString(),"ColumnDividerDoubleClick Event")

End Sub

Remarks

For more information about how to handle events, see Handling and Raising Events.

Constructors

DataGridViewColumnDividerDoubleClickEventArgs(Int32, HandledMouseEventArgs)

Initializes a new instance of the DataGridViewColumnDividerDoubleClickEventArgs class.

Properties

Button

Gets which mouse button was pressed.

(Inherited from MouseEventArgs)
Clicks

Gets the number of times the mouse button was pressed and released.

(Inherited from MouseEventArgs)
ColumnIndex

The index of the column next to the column divider that was double-clicked.

Delta

Gets a signed count of the number of detents the mouse wheel has rotated, multiplied by the WHEEL_DELTA constant. A detent is one notch of the mouse wheel.

(Inherited from MouseEventArgs)
Handled

Gets or sets whether this event should be forwarded to the control's parent container.

(Inherited from HandledMouseEventArgs)
Location

Gets the location of the mouse during the generating mouse event.

(Inherited from MouseEventArgs)
X

Gets the x-coordinate of the mouse during the generating mouse event.

(Inherited from MouseEventArgs)
Y

Gets the y-coordinate of the mouse during the generating mouse event.

(Inherited from MouseEventArgs)

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