Aracılığıyla paylaş


SplitterEventArgs.SplitX Özellik

Tanım

(istemci koordinatlarında) sol üst köşesinin x koordinatını Splitter alır veya ayarlar.

public:
 property int SplitX { int get(); void set(int value); };
public int SplitX { get; set; }
member this.SplitX : int with get, set
Public Property SplitX As Integer

Özellik Değeri

Denetimin sol üst köşesinin x koordinatı.

Örnekler

Aşağıdaki kod örneğinde bu üyenin kullanımı gösterilmektedir. Örnekte, olay işleyicisi olayın oluşumunu SplitContainer.SplitterMoved bildirir. Bu rapor, olayın ne zaman gerçekleştiğini öğrenmenize yardımcı olur ve hata ayıklamada size yardımcı olabilir. Birden çok olayı veya sık gerçekleşen olayları raporlamak için, iletisini ile MessageBox.Show değiştirmeyi Console.WriteLine veya çok satırlı TextBoxbir iletiye eklemeyi göz önünde bulundurun.

Örnek kodu çalıştırmak için, adlı SplitContainertürünün SplitContainer1 bir örneğini içeren bir projeye yapıştırın. Ardından olay işleyicisinin olayla ilişkilendirildiğinden SplitContainer.SplitterMoved emin olun.

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

Açıklamalar

ve SplitterMoved olayları tetiklendiğinde denetimin SplitY konumunu belirlemek için bu özelliği bu sınıfın SplitterSplitterMoving özelliğiyle birlikte kullanabilirsiniz.

Şunlara uygulanır

Ayrıca bkz.