Redigeeri

Jagamisviis:


SplitterEventArgs Class

Definition

Provides data for SplitterMoving and the SplitterMoved events.

public ref class SplitterEventArgs : EventArgs
[System.Runtime.InteropServices.ComVisible(true)]
public class SplitterEventArgs : EventArgs
public class SplitterEventArgs : EventArgs
[<System.Runtime.InteropServices.ComVisible(true)>]
type SplitterEventArgs = class
    inherit EventArgs
type SplitterEventArgs = class
    inherit EventArgs
Public Class SplitterEventArgs
Inherits EventArgs
Inheritance
SplitterEventArgs
Attributes

Examples

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

private void SplitContainer1_SplitterMoved(Object sender, SplitterEventArgs e) {

System.Text.StringBuilder messageBoxCS = new System.Text.StringBuilder();
messageBoxCS.AppendFormat("{0} = {1}", "X", e.X );
messageBoxCS.AppendLine();
messageBoxCS.AppendFormat("{0} = {1}", "Y", e.Y );
messageBoxCS.AppendLine();
messageBoxCS.AppendFormat("{0} = {1}", "SplitX", e.SplitX );
messageBoxCS.AppendLine();
messageBoxCS.AppendFormat("{0} = {1}", "SplitY", e.SplitY );
messageBoxCS.AppendLine();
MessageBox.Show(messageBoxCS.ToString(), "SplitterMoved Event" );
}
Private Sub SplitContainer1_SplitterMoved(sender as Object, e as SplitterEventArgs) _ 
     Handles SplitContainer1.SplitterMoved

    Dim messageBoxVB as New System.Text.StringBuilder()
    messageBoxVB.AppendFormat("{0} = {1}", "X", e.X)
    messageBoxVB.AppendLine()
    messageBoxVB.AppendFormat("{0} = {1}", "Y", e.Y)
    messageBoxVB.AppendLine()
    messageBoxVB.AppendFormat("{0} = {1}", "SplitX", e.SplitX)
    messageBoxVB.AppendLine()
    messageBoxVB.AppendFormat("{0} = {1}", "SplitY", e.SplitY)
    messageBoxVB.AppendLine()
    MessageBox.Show(messageBoxVB.ToString(),"SplitterMoved Event")

End Sub

Remarks

The SplitterMoving event occurs when the user is moving the Splitter control. The SplitterMoved event occurs when the user finishes moving the Splitter control. The SplitterEventArgs class specifies the position of the mouse pointer and the position of the upper-left corner of the Splitter control.

Constructors

SplitterEventArgs(Int32, Int32, Int32, Int32)

Initializes an instance of the SplitterEventArgs class with the specified coordinates of the mouse pointer and the coordinates of the upper-left corner of the Splitter control.

Properties

SplitX

Gets or sets the x-coordinate of the upper-left corner of the Splitter (in client coordinates).

SplitY

Gets or sets the y-coordinate of the upper-left corner of the Splitter (in client coordinates).

X

Gets the x-coordinate of the mouse pointer (in client coordinates).

Y

Gets the y-coordinate of the mouse pointer (in client coordinates).

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