PanelStyle.ScrollBars Proprietà

Definizione

Ottiene o imposta la visibilità e la posizione delle barre di scorrimento in un controllo pannello.

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

Valore della proprietà

ScrollBars

Uno dei valori di ScrollBars. Il valore predefinito è None.

Eccezioni

La proprietà ScrollBars non è inclusa nei valori ScrollBars.

Esempio

Nell'esempio di codice seguente vengono impostate le ScrollBars proprietà di due controlli Panel1 del pannello e Panel2, sul ScrollBars.Both valore di enumerazione. Questo esempio di codice fa parte di un esempio più grande fornito per la PanelStyle classe.

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

Commenti

La ScrollBars proprietà specifica la visibilità e la posizione delle barre di scorrimento in un controllo pannello.

La ScrollBars proprietà è impostata usando uno dei valori di ScrollBars enumerazione. Nella tabella seguente sono elencati i valori possibili.

Valore Descrizione
None Non viene visualizzata nessuna barra di scorrimento.
Horizontal Viene visualizzata solo una barra di scorrimento orizzontale.
Vertical Viene visualizzata solo una barra di scorrimento verticale.
Both Vengono visualizzate entrambe le barre di scorrimento orizzontali e verticali.
Auto Se necessario, vengono visualizzate entrambe le barre di scorrimento orizzontale, verticale o entrambe le barre di scorrimento. In caso contrario, non viene visualizzata alcuna barra di scorrimento.

Si applica a

Vedi anche