PanelStyle.Wrap Propiedad

Definición

Obtiene o establece un valor que indica si el contenido se ajusta dentro del panel.

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 propiedad

true si el contenido se ajusta dentro del panel; en caso contrario, false. De manera predeterminada, es true.

Ejemplos

En el ejemplo de código siguiente se establece la Wrap propiedad en para dos controles de panel y Panel2Panel1 .false Este ejemplo de código es parte de un ejemplo mayor proporcionado para la clase PanelStyle.

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 Wrap propiedad indica si el contenido se ajusta dentro del panel. Cuando la Wrap propiedad se establece false en y la ScrollBars propiedad se establece Autoen , si el contenido del panel es mayor que lo que cabe en el panel, el contenido del panel aparecerá en una línea con una barra de desplazamiento horizontal. Cuando la Wrap propiedad se establece false en y la ScrollBars propiedad se establece Noneen , el panel se extenderá y, si es necesario, la página web tendrá una barra de desplazamiento horizontal.

Se aplica a