PanelStyle.ScrollBars Propiedad

Definición

Obtiene o establece la visibilidad y posición de las barras de desplazamiento en un control de panel.

public:
 virtual property System::Web::UI::WebControls::ScrollBars ScrollBars { System::Web::UI::WebControls::ScrollBars get(); void set(System::Web::UI::WebControls::ScrollBars value); };
public virtual System.Web.UI.WebControls.ScrollBars ScrollBars { get; set; }
member this.ScrollBars : System.Web.UI.WebControls.ScrollBars with get, set
Public Overridable Property ScrollBars As ScrollBars

Valor de propiedad

ScrollBars

Uno de los valores de ScrollBars. De manera predeterminada, es None.

Excepciones

La propiedad ScrollBars no es ninguno de los valores de ScrollBars.

Ejemplos

En el ejemplo de código siguiente se establecen las ScrollBars propiedades de dos controles de panel y Panel1 Panel2, en el valor de ScrollBars.Both enumeración. Este ejemplo de código forma parte de un ejemplo más grande proporcionado para la PanelStyle clase .

public partial class PanelStylecs_aspx : Page
{
    void Page_Load(object sender, EventArgs e)
    {
        StateBag panelState = new StateBag();
        PanelStyle myPanelStyle = new PanelStyle(panelState);
        
        // Set the properties of the PanelStyle class.
        myPanelStyle.HorizontalAlign = HorizontalAlign.Center;
        myPanelStyle.ScrollBars = ScrollBars.Both;
        myPanelStyle.Wrap = false;
        myPanelStyle.Direction = ContentDirection.LeftToRight;
        myPanelStyle.BackImageUrl = @"~\images\picture.jpg";

        // Use the ApplyStyle method of the Panel control to apply
        // the settings from the myPanelStyle object.
        Panel1.ApplyStyle(myPanelStyle);
        Panel2.ApplyStyle(myPanelStyle); 
    }
}
Partial Class PanelStylevb_aspx
    Inherits Page

    Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)

        Dim panelState As StateBag = New StateBag()
        Dim myPanelStyle As PanelStyle = New PanelStyle(panelState)

        ' Set the properties of the PanelStyle class.
        myPanelStyle.HorizontalAlign = HorizontalAlign.Center
        myPanelStyle.ScrollBars = ScrollBars.Both
        myPanelStyle.Wrap = False
        myPanelStyle.Direction = ContentDirection.LeftToRight
        myPanelStyle.BackImageUrl = "~\images\picture.jpg"

        ' Use the ApplyStyle method of the Panel control to apply
        ' the settings from the myPanelStyle object.
        Panel1.ApplyStyle(myPanelStyle)
        Panel2.ApplyStyle(myPanelStyle)
        
    End Sub

End Class

Comentarios

La ScrollBars propiedad especifica la visibilidad y la posición de las barras de desplazamiento en un control de panel.

La ScrollBars propiedad se establece mediante uno de los ScrollBars valores de enumeración. En la tabla siguiente se enumeran los valores posibles.

Valor Descripción
None No se muestra ninguna barra de desplazamiento.
Horizontal Solo se muestra una barra de desplazamiento horizontal.
Vertical Solo se muestra una barra de desplazamiento vertical.
Both Se muestran las barras de desplazamiento horizontal y vertical.
Auto Si es necesario, se muestran las barras de desplazamiento horizontales, verticales o ambas. En caso contrario, no se muestran barras de desplazamiento.

Se aplica a

Consulte también