SplitterEventArgs Kelas

Definisi

Menyediakan data untuk SplitterMoving dan SplitterMoved peristiwa.

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

Contoh

Contoh kode berikut menunjukkan penggunaan jenis ini. Dalam contoh, penanganan aktivitas melaporkan kemunculan SplitterMoved peristiwa. Laporan ini membantu Anda mempelajari kapan peristiwa terjadi dan dapat membantu Anda dalam penelusuran kesalahan. Untuk melaporkan beberapa peristiwa atau peristiwa yang sering terjadi, pertimbangkan untuk mengganti Show dengan Console.WriteLine atau menambahkan pesan ke multibaris TextBox.

Untuk menjalankan kode contoh, tempelkan ke dalam proyek yang berisi instans jenis SplitContainer bernama SplitContainer1. Kemudian pastikan bahwa penanganan aktivitas dikaitkan dengan peristiwa.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

Keterangan

Peristiwa SplitterMoving terjadi ketika pengguna memindahkan Splitter kontrol. Peristiwa SplitterMoved terjadi ketika pengguna selesai memindahkan Splitter kontrol. Kelas SplitterEventArgs menentukan posisi penunjuk mouse dan posisi sudut Splitter kiri atas kontrol.

Konstruktor

SplitterEventArgs(Int32, Int32, Int32, Int32)

Menginisialisasi instans SplitterEventArgs kelas dengan koordinat penunjuk mouse yang ditentukan dan koordinat sudut Splitter kiri atas kontrol.

Properti

SplitX

Mendapatkan atau mengatur koordinat x dari sudut Splitter kiri atas (dalam koordinat klien).

SplitY

Mendapatkan atau mengatur koordinat y dari sudut Splitter kiri atas (dalam koordinat klien).

X

Mendapatkan koordinat x dari penunjuk mouse (dalam koordinat klien).

Y

Mendapatkan koordinat y dari penunjuk mouse (dalam koordinat klien).

Metode

Equals(Object)

Menentukan apakah objek yang ditentukan sama dengan objek saat ini.

(Diperoleh dari Object)
GetHashCode()

Berfungsi sebagai fungsi hash default.

(Diperoleh dari Object)
GetType()

Mendapatkan instans Type saat ini.

(Diperoleh dari Object)
MemberwiseClone()

Membuat salinan dangkal dari yang saat ini Object.

(Diperoleh dari Object)
ToString()

Mengembalikan string yang mewakili objek saat ini.

(Diperoleh dari Object)

Berlaku untuk

Lihat juga