SplitterEventArgs クラス

定義

SplitterMovingイベントとSplitterMoved イベントのデータを提供します。

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

次のコード例では、この型の使用方法を示します。 この例では、イベント ハンドラーは、 SplitterMoved イベントの発生を報告します。 このレポートは、イベントがいつ発生するかを学習するのに役立ち、デバッグに役立ちます。 複数のイベントや頻繁に発生するイベントについて報告するには、 ShowConsole.WriteLine に置き換えるか、メッセージを複数行の TextBoxに追加することを検討してください。

コード例を実行するには、SplitContainerという名前の型のインスタンスを含むプロジェクトSplitContainer1貼り付けます。 次に、イベント ハンドラーが SplitterMoved イベントに関連付けられていることを確認します。

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 コントロールを移動するときに発生します。 SplitterMoved イベントは、ユーザーが Splitter コントロールの移動を完了したときに発生します。 SplitterEventArgs クラスは、マウス ポインターの位置と、Splitter コントロールの左上隅の位置を指定します。

コンストラクター

名前 説明
SplitterEventArgs(Int32, Int32, Int32, Int32)

マウス ポインターの指定した座標とSplitter コントロールの左上隅の座標を使用して、SplitterEventArgs クラスのインスタンスを初期化します。

プロパティ

名前 説明
SplitX

Splitterの左上隅の x 座標を取得または設定します (クライアント座標)。

SplitY

Splitterの左上隅の y 座標を取得または設定します (クライアント座標)。

X

マウス ポインターの x 座標を取得します (クライアント座標)。

Y

マウス ポインターの y 座標を取得します (クライアント座標)。

メソッド

名前 説明
Equals(Object)

指定したオブジェクトが現在のオブジェクトと等しいかどうかを判断します。

(継承元 Object)
GetHashCode()

既定のハッシュ関数として機能します。

(継承元 Object)
GetType()

現在のインスタンスの Type を取得します。

(継承元 Object)
MemberwiseClone()

現在の Objectの簡易コピーを作成します。

(継承元 Object)
ToString()

現在のオブジェクトを表す文字列を返します。

(継承元 Object)

適用対象

こちらもご覧ください