PanelStyle.ScrollBars Propriedade

Definição

Obtém ou define a visibilidade e a posição das barras de scroll num controlo de painel.

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 Propriedade

Um dos ScrollBars valores. A predefinição é None.

Exceções

A ScrollBars propriedade não é um dos valores ScrollBars .

Exemplos

O exemplo de código seguinte define as ScrollBars propriedades de dois controlos de painel, Panel1 e Panel2, para o ScrollBars.Both valor de enumeração. Este exemplo de código faz parte de um exemplo maior fornecido para a 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

Observações

A ScrollBars propriedade especifica a visibilidade e a posição das barras de deslocamento num controlo de painel.

A ScrollBars propriedade é definida usando um dos ScrollBars valores de enumeração. A tabela seguinte lista os valores possíveis.

Value Description
None Não aparecem barras de scroll.
Horizontal Apenas uma barra de scroll horizontal é mostrada.
Vertical Apenas uma barra de scroll vertical é mostrada.
Both São mostradas barras de scroll horizontais e verticais.
Auto Se necessário, são mostradas as barras de scroll horizontais, verticais ou ambas. Caso contrário, não são mostradas barras de deslocamento.

Aplica-se a

Ver também