Splitter.SplitterMoving イベント

定義

分割コントロールの移動中に発生します。 SplitterMovingSplitterMoving によって置き換えられており、以前のバージョンと互換性を維持するためだけに残されています。

public:
 event System::Windows::Forms::SplitterEventHandler ^ SplitterMoving;
public event System.Windows.Forms.SplitterEventHandler SplitterMoving;
public event System.Windows.Forms.SplitterEventHandler? SplitterMoving;
member this.SplitterMoving : System.Windows.Forms.SplitterEventHandler 
Public Custom Event SplitterMoving As SplitterEventHandler 

イベントの種類

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

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

private void Splitter1_SplitterMoving(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(), "SplitterMoving Event" );
}
Private Sub Splitter1_SplitterMoving(sender as Object, e as SplitterEventArgs) _ 
     Handles Splitter1.SplitterMoving

    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(),"SplitterMoving Event")

End Sub

注釈

イベントのイベント ハンドラーを作成して、 SplitterMoving アプリケーションでサイズ変更の検証を実行できます。 たとえば、コントロールがコントロールとコントロールのTreeView端にドッキングされている場合Splitter、イベントにSplitterMovedコードを記述して、 コントロールと ListView コントロールの最小サイズまたは最大サイズTreeViewを超えたかどうかを判断し、コントロールのサイズ変更を最小サイズまたは最大サイズに制限できます。ListView

イベントの処理の詳細については、「処理とイベントの発生」を参照してください。

適用対象

こちらもご覧ください