Actualización: noviembre 2007
Representa una barra de desplazamiento horizontal estándar de Windows.
<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
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) }
Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98, Windows CE, Windows Mobile para Smartphone, Windows Mobile para Pocket PC