SplitterEventArgs SplitterEventArgs SplitterEventArgs 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
type SplitterEventArgs = class
    inherit EventArgs
Public Class SplitterEventArgs
Inherits EventArgs
Inheritance
SplitterEventArgsSplitterEventArgsSplitterEventArgsSplitterEventArgs
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) SplitterEventArgs(Int32, Int32, Int32, Int32) SplitterEventArgs(Int32, Int32, Int32, Int32) 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 SplitX SplitX SplitX

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

SplitY SplitY SplitY SplitY

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

X X X X

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

Y Y Y Y

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

Methods

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

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

(Inherited from Object)
GetHashCode() GetHashCode() GetHashCode() GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetType() GetType() GetType() GetType()

Gets the Type of the current instance.

(Inherited from Object)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
ToString() ToString() ToString() ToString()

Returns a string that represents the current object.

(Inherited from Object)

Applies to

See also