PanelStyle.Wrap Propriedade

Definição

Recebe ou define um valor que indica se o conteúdo se envolve dentro do painel.

public:
 virtual property bool Wrap { bool get(); void set(bool value); };
public virtual bool Wrap { get; set; }
member this.Wrap : bool with get, set
Public Overridable Property Wrap As Boolean

Valor de Propriedade

true se o conteúdo se envolver dentro do painel; caso contrário, false. A predefinição é true.

Exemplos

O exemplo de código seguinte define a Wrap propriedade para false dois controlos de painel, Panel1 e Panel2. 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 Wrap propriedade indica se o conteúdo se engloba dentro do painel. Quando a Wrap propriedade está definida para false e a ScrollBars propriedade está definida para Auto, se o conteúdo do painel for maior do que o que caberia no painel, o conteúdo do painel aparecerá numa linha com uma barra de scroll horizontal. Quando a Wrap propriedade está definida como false e a ScrollBars propriedade está definida como None, o painel estende-se e, se necessário, a página Web terá uma barra de deslocamento horizontal.

Aplica-se a