Compartilhar via


PanelStyle.Wrap Propriedade

Definição

Obtém ou define um valor que indica se o conteúdo será quebrado 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 da propriedade

Boolean

true se o conteúdo for quebrado dentro do painel; caso contrário, false. O padrão é true.

Exemplos

O exemplo de código a seguir define a Wrap propriedade para false dois controles Panel1 de painel 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

Comentários

A Wrap propriedade indica se o conteúdo é encapsulado no painel. Quando a Wrap propriedade estiver definida false como e a ScrollBars propriedade estiver definida como Auto, se o conteúdo do painel for maior do que o que caberá no painel, o conteúdo do painel será exibido em uma linha com uma barra de rolagem horizontal. Quando a Wrap propriedade estiver definida false e a ScrollBars propriedade estiver definida como None, o painel será estendido e, se necessário, a página da Web terá uma barra de rolagem horizontal.

Aplica-se a