Representa una barra de desplazamiento horizontal estándar de Windows.
Espacio de nombres: System.Windows.Forms
Ensamblado: System.Windows.Forms (en system.windows.forms.dll)
Visual Basic (Declaración)
<ClassInterfaceAttribute(ClassInterfaceType.AutoDispatch)> _
<ComVisibleAttribute(True)> _
Public Class HScrollBar
Inherits ScrollBar
Dim instance As HScrollBar
[ClassInterfaceAttribute(ClassInterfaceType.AutoDispatch)]
[ComVisibleAttribute(true)]
public class HScrollBar : ScrollBar
[ClassInterfaceAttribute(ClassInterfaceType::AutoDispatch)]
[ComVisibleAttribute(true)]
public ref class HScrollBar : public ScrollBar
/** @attribute ClassInterfaceAttribute(ClassInterfaceType.AutoDispatch) */
/** @attribute ComVisibleAttribute(true) */
public class HScrollBar extends ScrollBar
ClassInterfaceAttribute(ClassInterfaceType.AutoDispatch)
ComVisibleAttribute(true)
public class HScrollBar extends ScrollBar
La mayoría de los controles que necesitan barras de desplazamiento ya las incluyen y no requieren este control. Es el caso de un control TextBox de varias líneas, ListBox y ComboBox, por ejemplo.
Se puede utilizar este control para implementar el desplazamiento en los contenedores que no proporcionan sus propias barras de desplazamiento, como PictureBox, o para la introducción de datos numéricos por el usuario. Los datos numéricos se pueden mostrar en un control o se pueden utilizar en el código. Las propiedades Minimum y Maximum determinan el intervalo de valores que el usuario puede seleccionar. La propiedad LargeChange determina el efecto de hacer clic dentro de la barra de desplazamiento, pero fuera del cuadro de desplazamiento. La propiedad SmallChange determina el efecto de hacer clic en las flechas de desplazamiento situadas en cada extremo del control.
En el siguiente ejemplo se crea y se inicializa una HScrollBar, y se agrega a Form.
Private Sub InitializeMyScrollBar()
' Create and initialize an HScrollBar.
Dim hScrollBar1 As New HScrollBar()
' Dock the scroll bar to the bottom of the form.
hScrollBar1.Dock = DockStyle.Bottom
' Add the scroll bar to the form.
Controls.Add(hScrollBar1)
End Sub 'InitializeMyScrollBar
private void InitializeMyScrollBar()
{
// Create and initialize an HScrollBar.
HScrollBar hScrollBar1 = new HScrollBar();
// Dock the scroll bar to the bottom of the form.
hScrollBar1.Dock = DockStyle.Bottom;
// Add the scroll bar to the form.
Controls.Add(hScrollBar1);
}
private:
void InitializeMyScrollBar()
{
// Create and initialize an HScrollBar.
HScrollBar^ hScrollBar1 = gcnew HScrollBar;
// Dock the scroll bar to the bottom of the form.
hScrollBar1->Dock = DockStyle::Bottom;
// Add the scroll bar to the form.
Controls->Add( hScrollBar1 );
}
private void InitializeMyScrollBar()
{
// Create and initialize an HScrollBar.
HScrollBar hScrollBar1 = new HScrollBar();
// Dock the scroll bar to the bottom of the form.
hScrollBar1.set_Dock(DockStyle.Bottom);
// Add the scroll bar to the form.
get_Controls().Add(hScrollBar1);
} //InitializeMyScrollBar
function InitializeMyScrollBar(){
// Create and initialize an HScrollBar.
var hScrollBar1 : HScrollBar = new HScrollBar()
// Dock the scroll bar to the bottom of the form.
hScrollBar1.Dock = DockStyle.Bottom
// Add the scroll bar to the form.
Controls.Add(hScrollBar1)
}
System.Object
System.MarshalByRefObject
System.ComponentModel.Component
System.Windows.Forms.Control
System.Windows.Forms.ScrollBar
System.Windows.Forms.HScrollBar
Seguridad para subprocesos
Los miembros estáticos públicos (Shared en Visual Basic) de este tipo son seguros para la ejecución de subprocesos. No se garantiza que los miembros de instancias sean seguros para la ejecución de subprocesos.
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, 1.1, 1.0
.NET Compact Framework
Compatible con: 2.0, 1.0