Esta documentación está archivada y no tiene mantenimiento.

SplitContainer.SplitterWidth (Propiedad)

Obtiene o establece el ancho del divisor, en píxeles.

Espacio de nombres: System.Windows.Forms
Ensamblado: System.Windows.Forms (en system.windows.forms.dll)

[LocalizableAttribute(true)] 
public int SplitterWidth { get; set; }
/** @property */
public int get_SplitterWidth ()

/** @property */
public void set_SplitterWidth (int value)

public function get SplitterWidth () : int

public function set SplitterWidth (value : int)

No aplicable.

Valor de propiedad

System.Int32 que representa el ancho del divisor, en píxeles. El valor predeterminado es de cuatro píxeles.

Tipo de excepciónCondición

ArgumentOutOfRangeException

El valor es menor que uno o no es compatible con la orientación.

Utilice la propiedad SplitterWidth para cambiar el ancho del propio divisor, no de SplitContainer.

El ejemplo de código siguiente especifica que el ancho inicial del divisor vertical es de 6 píxeles (el valor predeterminado). También se muestran otras propiedades básicas de un divisor vertical. Este ejemplo forma parte de un ejemplo más extenso referente a la clase SplitContainer.

// Basic SplitContainer properties.
// This is a vertical splitter that moves in 10-pixel increments.
// This splitter needs no explicit Orientation property because Vertical is the default.
splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
splitContainer1.ForeColor = System.Drawing.SystemColors.Control;
splitContainer1.Location = new System.Drawing.Point(0, 0);
splitContainer1.Name = "splitContainer1";
// You can drag the splitter no nearer than 30 pixels from the left edge of the container.
splitContainer1.Panel1MinSize = 30;
// You can drag the splitter no nearer than 20 pixels from the right edge of the container.
splitContainer1.Panel2MinSize = 20;
splitContainer1.Size = new System.Drawing.Size(292, 273);
splitContainer1.SplitterDistance = 79;
// This splitter moves in 10-pixel increments.
splitContainer1.SplitterIncrement = 10;
splitContainer1.SplitterWidth = 6;
// splitContainer1 is the first control in the tab order.
splitContainer1.TabIndex = 0;
splitContainer1.Text = "splitContainer1";
// When the splitter moves, the cursor changes shape.
splitContainer1.SplitterMoved += new System.Windows.Forms.SplitterEventHandler(splitContainer1_SplitterMoved);
splitContainer1.SplitterMoving += new System.Windows.Forms.SplitterCancelEventHandler(splitContainer1_SplitterMoving);

// Add a TreeView control to the left panel.
splitContainer1.Panel1.BackColor = System.Drawing.SystemColors.Control;
// Add a TreeView control to Panel1.
splitContainer1.Panel1.Controls.Add(treeView1);
splitContainer1.Panel1.Name = "splitterPanel1";
// Controls placed on Panel1 support right-to-left fonts.
splitContainer1.Panel1.RightToLeft = System.Windows.Forms.RightToLeft.Yes;


// Basic SplitContainer properties.
// This is a vertical splitter that moves in 10-pixel increments.
// This splitter needs no explicit Orientation property because 
// Vertical is the default.
splitContainer1.set_Dock(System.Windows.Forms.DockStyle.Fill);
splitContainer1.set_ForeColor(System.Drawing.SystemColors.get_Control());
splitContainer1.set_Location(new System.Drawing.Point(0, 0));
splitContainer1.set_Name("splitContainer1");

// You can drag the splitter no nearer than 30 pixels from the 
// left edge of the container.
splitContainer1.set_Panel1MinSize(30);

// You can drag the splitter no nearer than 20 pixels from the 
// right edge of the container.
splitContainer1.set_Panel2MinSize(20);
splitContainer1.set_Size(new System.Drawing.Size(292, 273));
splitContainer1.set_SplitterDistance(79);

// This splitter moves in 10-pixel increments.
splitContainer1.set_SplitterIncrement(10);
splitContainer1.set_SplitterWidth(6);

// splitContainer1 is the first control in the tab order.
splitContainer1.set_TabIndex(0);
splitContainer1.set_Text("splitContainer1");

// When the splitter moves, the cursor changes shape.
splitContainer1.add_SplitterMoved(new System.Windows.Forms.
    SplitterEventHandler(splitContainer1_SplitterMoved));
splitContainer1.add_SplitterMoving(new System.Windows.Forms.
    SplitterCancelEventHandler(splitContainer1_SplitterMoving));

// Add a TreeView control to the left panel.
splitContainer1.get_Panel1().set_BackColor(System.Drawing.SystemColors.
    get_Control());

// Add a TreeView control to Panel1.
splitContainer1.get_Panel1().get_Controls().Add(treeView1);
splitContainer1.get_Panel1().set_Name("splitterPanel1");

// Controls placed on Panel1 support right-to-left fonts.
splitContainer1.get_Panel1().set_RightToLeft(System.Windows.Forms.
    RightToLeft.Yes);

Windows 98, Windows 2000 Service Pack 4, Windows CE, Windows Millennium, Windows Mobile para Pocket PC, Windows Mobile para Smartphone, Windows Server 2003, Windows XP Media Center, Windows XP Professional x64, Windows XP SP2, Windows XP Starter

Microsoft .NET Framework 3.0 es compatible con Windows Vista, Microsoft Windows XP SP2 y Windows Server 2003 SP1.

.NET Framework

Compatible con: 3.0, 2.0
Mostrar: