PanelStyle.BackImageUrl Propiedad

Definición

Obtiene o establece la dirección URL de la imagen de fondo para el control del panel.

public:
 virtual property System::String ^ BackImageUrl { System::String ^ get(); void set(System::String ^ value); };
public virtual string BackImageUrl { get; set; }
member this.BackImageUrl : string with get, set
Public Overridable Property BackImageUrl As String

Valor de propiedad

La dirección URL de la imagen de fondo para el control del panel. El valor predeterminado es una cadena vacía ("").

Excepciones

La propiedad BackImageUrl es null.

Ejemplos

En el ejemplo de código siguiente se aplica la misma imagen de fondo a dos controles de panel y Panel1Panel2. Para que este ejemplo funcione correctamente, debe proporcionar su propia imagen. 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 BackImageUrl propiedad especifica la dirección URL de la imagen de fondo para el control del panel. Para que esta propiedad funcione, debe existir un archivo de imagen en la ubicación especificada. Si el archivo de imagen especificado no es accesible, el control del panel se muestra sin una imagen de fondo.

Se aplica a