SplitContainer.OnSplitterMoved メソッドとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > SplitContainer.OnSplitterMoved メソッドの意味・解説 

SplitContainer.OnSplitterMoved メソッド

メモ : このメソッドは、.NET Framework version 2.0新しく追加されたものです。

SplitterMoved イベント発生させます

名前空間: System.Windows.Forms
アセンブリ: System.Windows.Forms (system.windows.forms.dll 内)
構文構文

Public Sub OnSplitterMoved ( _
    e As SplitterEventArgs _
)
Dim instance As SplitContainer
Dim e As SplitterEventArgs

instance.OnSplitterMoved(e)
public void OnSplitterMoved (
    SplitterEventArgs e
)
public:
void OnSplitterMoved (
    SplitterEventArgs^ e
)
public void OnSplitterMoved (
    SplitterEventArgs e
)
public function OnSplitterMoved (
    e : SplitterEventArgs
)

パラメータ

e

イベント データ格納している SplitterEventArgs。

解説解説
使用例使用例

SplitterMoving イベント発生させるコード例次に示します。この例では、分割線を移動したときにカーソル スタイル変更されることによって、このイベントの発生通知されます。分割線の移動中止されると、SplitterMoved イベント発生します。この例では、カーソル スタイル既定スタイルに戻ることによって、このイベントの発生通知されます。

' Compile this example using the following command line:
' vbc splitcontainerevents.vb /r:System.Drawing.dll /r:System.Windows.Forms.dll
 /r:System.dll /r:System.Data.dll
Imports System
Imports System.Drawing
Imports System.Collections
Imports System.ComponentModel
Imports System.Windows.Forms
Imports System.Data
Imports Microsoft.VisualBasic

' Create an empty Windows form.
Public Class Form1
    Inherits System.Windows.Forms.Form
    ' This is the event handler for the SplitterMoving and SplitterMoved
 events.
    Private WithEvents SplitContainer1 As
 System.Windows.Forms.SplitContainer

    Public Sub New()
        InitializeComponent()
    End Sub


Private Sub InitializeComponent()
SplitContainer1 = New System.Windows.Forms.SplitContainer
SplitContainer1.SuspendLayout()
SuspendLayout()

' Place a basic SplitContainer control onto Form1.
SplitContainer1.Dock = System.Windows.Forms.DockStyle.Fill
SplitContainer1.Location = New System.Drawing.Point(0, 0)
SplitContainer1.Name = "SplitContainer1"
SplitContainer1.Size = New System.Drawing.Size(292, 273)
SplitContainer1.SplitterDistance = 39
SplitContainer1.SplitterWidth = 6
SplitContainer1.TabIndex = 0
SplitContainer1.Text = "SplitContainer1"

' This is the left panel of the vertical SplitContainer control.

SplitContainer1.Panel1.Name = "SplitterPanel1"

' This is the right panel of the vertical SplitContainer control.
SplitContainer1.Panel2.Name = "SplitterPanel2"

' Lay out the basic properties of the form.
ClientSize = New System.Drawing.Size(292, 273)
Controls.Add(SplitContainer1)
Name = "Form1"
Text = "Form1"
SplitContainer1.ResumeLayout(False)
ResumeLayout(False)

    End Sub

<STAThread()>  _
Shared Sub Main()
    Application.Run(New Form1())
End Sub 'Main

    Private Sub SplitContainer1_SplitterMoving(ByVal
 sender As Object, ByVal
 e As System.Windows.Forms.SplitterCancelEventArgs) Handles SplitContainer1.SplitterMoving
        ' Define what happens while the splitter is moving.
        Cursor.Current = System.Windows.Forms.Cursors.NoMoveVert
    End Sub

    Private Sub SplitContainer1_SplitterMoved(ByVal
 sender As Object, ByVal
 e As System.Windows.Forms.SplitterEventArgs) Handles SplitContainer1.SplitterMoved
        ' Define what happens when the splitter is no longer moving.
        Cursor.Current = System.Windows.Forms.Cursors.Default
    End Sub
End Class
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;

public class Form1 : System.Windows.Forms.Form
{
private System.Windows.Forms.SplitContainer splitContainer1;

// Create an empty Windows form.
public Form1()
    {
    InitializeComponent();
    }
    private void InitializeComponent()
    {
        splitContainer1 = new System.Windows.Forms.SplitContainer();
        splitContainer1.SuspendLayout();
        SuspendLayout();

        // Place a basic SplitContainer control onto Form1.
        splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
        splitContainer1.Location = new System.Drawing.Point(0,
 0);
        splitContainer1.Name = "splitContainer1";
        splitContainer1.Size = new System.Drawing.Size(292, 273);
        splitContainer1.SplitterDistance = 52;
        splitContainer1.SplitterWidth = 6;
        splitContainer1.TabIndex = 0;
        splitContainer1.Text = "splitContainer1";

        // Add the event handler for the SplitterMoved event.
        splitContainer1.SplitterMoved += new System.Windows.Forms.SplitterEventHandler(splitContainer1_SplitterMoved);

        // Add the event handler for the SplitterMoving event.
        splitContainer1.SplitterMoving += new System.Windows.Forms.SplitterCancelEventHandler(splitContainer1_SplitterMoving);
 
        // This is the left panel of the vertical SplitContainer control.
        splitContainer1.Panel1.Name = "splitterPanel1";
 
        // This is the right panel of the vertical SplitContainer control.
        splitContainer1.Panel2.Name = "splitterPanel2";

        // Lay out the basic properties of the form.
        ClientSize = new System.Drawing.Size(292, 273);
        Controls.Add(splitContainer1);
        Name = "Form1";
        Text = "Form1";
        splitContainer1.ResumeLayout(false);
        ResumeLayout(false);

    }
    [STAThread]
    static void Main() 
    {
        Application.Run(new Form1());
    }

    private void splitContainer1_SplitterMoved(System.Object
 sender, System.Windows.Forms.SplitterEventArgs e)
    {
    // Define what happens when the splitter is no longer moving.
    Cursor.Current=System.Windows.Forms.Cursors.Default;
    }

    private void splitContainer1_SplitterMoving(System.Object
 sender, System.Windows.Forms.SplitterCancelEventArgs e)
    {
    // Define what happens while the splitter is moving.
    Cursor.Current=System.Windows.Forms.Cursors.NoMoveVert;
    }
}
#using <System.Data.dll>
#using <System.Windows.Forms.dll>
#using <System.dll>
#using <System.Drawing.dll>

using namespace System;
using namespace System::Drawing;
using namespace System::Collections;
using namespace System::ComponentModel;
using namespace System::Windows::Forms;
using namespace System::Data;
public ref class Form1: public
 System::Windows::Forms::Form
{
private:
   System::Windows::Forms::SplitContainer^ splitContainer1;

public:

   // Create an empty Windows form.
   Form1()
   {
      InitializeComponent();
   }


private:
   void InitializeComponent()
   {
      splitContainer1 = gcnew System::Windows::Forms::SplitContainer;
      splitContainer1->SuspendLayout();
      SuspendLayout();
      
      // Place a basic SplitContainer control onto Form1.
      splitContainer1->Dock = System::Windows::Forms::DockStyle::Fill;
      splitContainer1->Location = System::Drawing::Point( 0, 0 );
      splitContainer1->Name = "splitContainer1";
      splitContainer1->Size = System::Drawing::Size( 292, 273 );
      splitContainer1->SplitterDistance = 52;
      splitContainer1->SplitterWidth = 6;
      splitContainer1->TabIndex = 0;
      splitContainer1->Text = "splitContainer1";
      
      // Add the event handler for the SplitterMoved event.
      splitContainer1->SplitterMoved += gcnew System::Windows::Forms::SplitterEventHandler(
 this, &Form1::splitContainer1_SplitterMoved );
      
      // Add the event handler for the SplitterMoving event.
      splitContainer1->SplitterMoving += gcnew System::Windows::Forms::SplitterCancelEventHandler(
 this, &Form1::splitContainer1_SplitterMoving );
      
      // This is the left panel of the vertical SplitContainer control.
      splitContainer1->Panel1->Name = "splitterPanel1";
      
      // This is the right panel of the vertical SplitContainer control.
      splitContainer1->Panel2->Name = "splitterPanel2";
      
      // Lay out the basic properties of the form.
      ClientSize = System::Drawing::Size( 292, 273 );
      Controls->Add( splitContainer1 );
      Name = "Form1";
      Text = "Form1";
      splitContainer1->ResumeLayout( false );
      ResumeLayout( false );
   }

   void splitContainer1_SplitterMoved( System::Object^ /*sender*/,
 System::Windows::Forms::SplitterEventArgs^ /*e*/ )
   {
      
      // Define what happens when the splitter is no longer moving.
      ::Cursor::Current = System::Windows::Forms::Cursors::Default;
   }

   void splitContainer1_SplitterMoving( System::Object^ /*sender*/,
 System::Windows::Forms::SplitterCancelEventArgs ^ /*e*/ )
   {
      
      // Define what happens while the splitter is moving.
      ::Cursor::Current = System::Windows::Forms::Cursors::NoMoveVert;
   }

};


[STAThread]
int main()
{
   Application::Run( gcnew Form1 );
}

import System.*;
import System.Drawing.*;
import System.Collections.*;
import System.ComponentModel.*;
import System.Windows.Forms.*;
import System.Data.*;

public class Form1 extends System.Windows.Forms.Form
{
    private System.Windows.Forms.SplitContainer splitContainer1;

    // Create an empty Windows form.
    public Form1()
    {
        InitializeComponent();
    } //Form1

    private void InitializeComponent()
    {
        splitContainer1 = new System.Windows.Forms.SplitContainer();
        splitContainer1.SuspendLayout();
        SuspendLayout();
        // Place a basic SplitContainer control onto Form1.
        splitContainer1.set_Dock(System.Windows.Forms.DockStyle.Fill);
        splitContainer1.set_Location(new System.Drawing.Point(0,
 0));
        splitContainer1.set_Name("splitContainer1");
        splitContainer1.set_Size(new System.Drawing.Size(292,
 273));
        splitContainer1.set_SplitterDistance(52);
        splitContainer1.set_SplitterWidth(6);
        splitContainer1.set_TabIndex(0);
        splitContainer1.set_Text("splitContainer1");
        // Add the event handler for the SplitterMoved event.
        splitContainer1.add_SplitterMoved(new System.Windows.Forms.
            SplitterEventHandler(splitContainer1_SplitterMoved));
        // Add the event handler for the SplitterMoving event.
        splitContainer1.add_SplitterMoving(new System.Windows.Forms.
                                   SplitterCancelEventHandler(splitContainer1_SplitterMoving));
        // This is the left panel of the vertical SplitContainer control.
        splitContainer1.get_Panel1().set_Name("splitterPanel1");
        // This is the right panel of the vertical SplitContainer control.
        splitContainer1.get_Panel2().set_Name("splitterPanel2");
        // Lay out the basic properties of the form.
        set_ClientSize(new System.Drawing.Size(292, 273));
        get_Controls().Add(splitContainer1);
        set_Name("Form1");
        set_Text("Form1");
        splitContainer1.ResumeLayout(false);
        ResumeLayout(false);
    } //InitializeComponent

    /** @attribute STAThread()
     */
    public static void main(String[]
 args)
    {
        Application.Run(new Form1());
    } //main

    private void splitContainer1_SplitterMoved(System.Object
 sender, 
        System.Windows.Forms.SplitterEventArgs e)
    {
        // Define what happens when the splitter is no longer moving.
        get_Cursor().set_Current(System.Windows.Forms.Cursors.get_Default());
    } //splitContainer1_SplitterMoved

    private void splitContainer1_SplitterMoving(System.Object
 sender, 
        System.Windows.Forms.SplitterCancelEventArgs e)
    {
        // Define what happens while the splitter is moving.
        get_Cursor().set_Current(System.Windows.Forms.Cursors.get_NoMoveVert());
    } //splitContainer1_SplitterMoving
} //Form1
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
SplitContainer クラス
SplitContainer メンバ
System.Windows.Forms 名前空間
SplitterEventArgs
SplitterEventHandler
SplitterMoving
SplitterMoved


このページでは「.NET Framework クラス ライブラリ リファレンス」からSplitContainer.OnSplitterMoved メソッドを検索した結果を表示しています。
Weblioに収録されているすべての辞書からSplitContainer.OnSplitterMoved メソッドを検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からSplitContainer.OnSplitterMoved メソッド を検索

英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「SplitContainer.OnSplitterMoved メソッド」の関連用語

SplitContainer.OnSplitterMoved メソッドのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



SplitContainer.OnSplitterMoved メソッドのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2025 Microsoft.All rights reserved.

©2025 GRAS Group, Inc.RSS