SplitterEventArgs 類別

定義

提供 SplitterMovingSplitterMoved 事件的資料。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
繼承
SplitterEventArgs
屬性

範例

下列程式碼範例示範如何使用這個類型。The following code example demonstrates the use of this type. 在此範例中, 事件處理常式會報告SplitterMoved事件的發生次數。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. 若要報告多個事件或經常發生的事件, 請考慮ShowConsole.WriteLine取代為, 或將訊息附加TextBox至多行。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.

若要執行範例程式碼, 請將它貼入包含名為SplitContainer SplitContainer1之類型實例的專案中。To run the example code, paste it into a project that contains an instance of type SplitContainer named SplitContainer1. 然後確定事件處理常式與SplitterMoved事件相關聯。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

備註

SplitterMoving 使用者Splitter移動控制項時, 就會發生此事件。The SplitterMoving event occurs when the user is moving the Splitter control. SplitterMoved使用者完成Splitter移動控制項時, 就會發生此事件。The SplitterMoved event occurs when the user finishes moving the Splitter control. 類別會指定滑鼠指標的位置, 以及Splitter控制項左上角的位置。 SplitterEventArgsThe SplitterEventArgs class specifies the position of the mouse pointer and the position of the upper-left corner of the Splitter control.

建構函式

SplitterEventArgs(Int32, Int32, Int32, Int32)

使用指定的滑鼠指標和 SplitterEventArgs 控制項左上角的座標,初始化 Splitter 類別的執行個體。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.

屬性

SplitX

取得或設定 Splitter 左上角的 X 座標 (在工作區座標中)。Gets or sets the x-coordinate of the upper-left corner of the Splitter (in client coordinates).

SplitY

取得或是定 Splitter 左上角的 Y 座標 (在工作區座標中)。Gets or sets the y-coordinate of the upper-left corner of the Splitter (in client coordinates).

X

取得滑鼠指標的 X 座標 (在工作區座標中)。Gets the x-coordinate of the mouse pointer (in client coordinates).

Y

取得滑鼠指標的 Y 座標 (在工作區座標中)。Gets the y-coordinate of the mouse pointer (in client coordinates).

方法

Equals(Object)

判斷指定的物件是否等於目前的物件。Determines whether the specified object is equal to the current object.

(繼承來源 Object)
GetHashCode()

做為預設雜湊函式。Serves as the default hash function.

(繼承來源 Object)
GetType()

取得目前執行個體的 TypeGets the Type of the current instance.

(繼承來源 Object)
MemberwiseClone()

建立目前 Object 的淺層複本 (Shallow Copy)。Creates a shallow copy of the current Object.

(繼承來源 Object)
ToString()

傳回代表目前物件的字串。Returns a string that represents the current object.

(繼承來源 Object)

適用於

另請參閱